Documentation
¶
Index ¶
- Constants
- Variables
- func NewFactory(b bus.Bus) controller.Factory
- func ResolveStarlarkPath(configPath string) string
- type Config
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(c2 config.Config) bool
- func (x *Config) GetBoundRemotes() map[string]*project.RemoteConfig
- func (c *Config) GetConfigID() string
- func (x *Config) GetConfigPath() string
- func (x *Config) GetDisableWatch() bool
- func (x *Config) GetProjectControllerConfig() *controller.Config
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Config_BoundRemotesEntry
- func (x *Config_BoundRemotesEntry) GetKey() string
- func (x *Config_BoundRemotesEntry) GetValue() *project.RemoteConfig
- func (x *Config_BoundRemotesEntry) MarshalJSON() ([]byte, error)
- func (x *Config_BoundRemotesEntry) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config_BoundRemotesEntry) MarshalProtoText() string
- func (*Config_BoundRemotesEntry) ProtoMessage()
- func (x *Config_BoundRemotesEntry) Reset()
- func (x *Config_BoundRemotesEntry) String() string
- func (x *Config_BoundRemotesEntry) UnmarshalJSON(b []byte) error
- func (x *Config_BoundRemotesEntry) UnmarshalProtoJSON(s *json.UnmarshalState)
- type Controller
- type Factory
Constants ¶
const ConfigID = "bldr/project/watcher"
ConfigID is the identifier for the config type.
const ControllerID = ConfigID
ControllerID is the ID of the controller.
Variables ¶
var Version = controller.MustParseVersion("0.0.1")
Version is the version of the controller implementation.
Functions ¶
func NewFactory ¶
func NewFactory(b bus.Bus) controller.Factory
NewFactory constructs a new controller factory.
func ResolveStarlarkPath ¶
ResolveStarlarkPath returns the bldr.star path beside a config path. e.g. "bldr.yaml" -> "bldr.star", "path/to/bldr.yaml" -> "path/to/bldr.star"
Types ¶
type Config ¶
type Config struct {
// ConfigPath is the path to load the bldr.yaml configuration.
// If the path is empty, starts the project controller with a blank config.
ConfigPath string `protobuf:"bytes,1,opt,name=config_path,json=configPath,proto3" json:"configPath,omitempty"`
// ProjectControllerConfig configures the project controller.
// The loaded project controller config will be merged into this config.
ProjectControllerConfig *controller.Config `` /* 130-byte string literal not displayed */
// DisableWatch disables watching the file (loads once only).
DisableWatch bool `protobuf:"varint,3,opt,name=disable_watch,json=disableWatch,proto3" json:"disableWatch,omitempty"`
// BoundRemotes are caller-supplied World capabilities. These bindings take
// precedence over source configuration, including watched configuration edits.
BoundRemotes map[string]*project.RemoteConfig `` /* 184-byte string literal not displayed */
// contains filtered or unexported fields
}
Config configures the project file watcher.
func NewConfig ¶
func NewConfig( configPath string, projCtrlConfig *bldr_project_controller.Config, ) *Config
NewConfig constructs the configuration.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks equality between two configs.
func (*Config) GetBoundRemotes ¶
func (x *Config) GetBoundRemotes() map[string]*project.RemoteConfig
func (*Config) GetConfigID ¶
GetConfigID returns the config identifier.
func (*Config) GetConfigPath ¶
func (*Config) GetDisableWatch ¶
func (*Config) GetProjectControllerConfig ¶
func (x *Config) GetProjectControllerConfig() *controller.Config
func (*Config) MarshalJSON ¶
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶
type Config_BoundRemotesEntry ¶
type Config_BoundRemotesEntry struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value *project.RemoteConfig `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
func (*Config_BoundRemotesEntry) GetKey ¶
func (x *Config_BoundRemotesEntry) GetKey() string
func (*Config_BoundRemotesEntry) GetValue ¶
func (x *Config_BoundRemotesEntry) GetValue() *project.RemoteConfig
func (*Config_BoundRemotesEntry) MarshalJSON ¶
func (x *Config_BoundRemotesEntry) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Config_BoundRemotesEntry to JSON.
func (*Config_BoundRemotesEntry) MarshalProtoJSON ¶
func (x *Config_BoundRemotesEntry) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config_BoundRemotesEntry message to JSON.
func (*Config_BoundRemotesEntry) MarshalProtoText ¶
func (x *Config_BoundRemotesEntry) MarshalProtoText() string
func (*Config_BoundRemotesEntry) ProtoMessage ¶
func (*Config_BoundRemotesEntry) ProtoMessage()
func (*Config_BoundRemotesEntry) Reset ¶
func (x *Config_BoundRemotesEntry) Reset()
func (*Config_BoundRemotesEntry) String ¶
func (x *Config_BoundRemotesEntry) String() string
func (*Config_BoundRemotesEntry) UnmarshalJSON ¶
func (x *Config_BoundRemotesEntry) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the Config_BoundRemotesEntry from JSON.
func (*Config_BoundRemotesEntry) UnmarshalProtoJSON ¶
func (x *Config_BoundRemotesEntry) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config_BoundRemotesEntry message from JSON.
type Controller ¶
type Controller struct {
*bus.BusController[*Config]
// contains filtered or unexported fields
}
Controller is the bldr Project Watcher controller.
func (*Controller) Execute ¶
func (c *Controller) Execute(rctx context.Context) error
Execute executes the controller goroutine. Returning nil ends execution. Returning an error triggers a retry with backoff.
func (*Controller) GetProjectController ¶
func (c *Controller) GetProjectController() ccontainer.Watchable[*bldr_project_controller.Controller]
GetProjectController returns the project controller watchable.
type Factory ¶
type Factory = bus.BusFactory[*Config, *Controller]
Factory is the factory for the controller.