about summary refs log tree commit diff
path: root/tools/nixery/server/builder/state.go
blob: 1c7f58821b6b7fb9cdaba6f25103065975aca14a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package builder

import (
	"cloud.google.com/go/storage"
	"github.com/google/nixery/config"
	"github.com/google/nixery/layers"
)

// State holds the runtime state that is carried around in Nixery and
// passed to builder functions.
type State struct {
	Bucket *storage.BucketHandle
	Cache  LocalCache
	Cfg    config.Config
	Pop    layers.Popularity
}

func NewState(bucket *storage.BucketHandle, cfg config.Config) State {
	return State{
		Bucket: bucket,
		Cfg:    cfg,
		Cache:  NewCache(),
	}
}