Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PouleUpdateCallback func(repository string) error
PouleUpdateCallback is the callback to call when a configuration update is required.
OK, global state is terrible, but I like to think of `pouleUpdaterOperation` as an exception rather than the norm. If more of such operations need to exist in the future, we may want to create a special kind of "core operations" which have privileged access to the configuration.
Functions ¶
func OperationFromConfig ¶
func OperationFromConfig(operationConfig *configuration.OperationConfiguration) (operations.Operation, error)
OperationFromConfig returns an operation parsed from the configuration.
Types ¶
type CommandLineDescription ¶
type CommandLineDescription struct { // Name is the operation's command. Name string // Description is the operation's help message. Description string // Flags is an array of operation-specific command line flags. Flags []cli.Flag // ArgsUsage describes the arguments to this command. ArgsUsage string }
CommandLineDescription describes the command-line interface for an operation.
type OperationDescriptor ¶
type OperationDescriptor interface { // CommandLineDescription returns the necessary information to populate the // command line with that operation. CommandLineDescription() CommandLineDescription // OperationFromCli returns a new instance of that operations configured as // described by command line flags and arguments. OperationFromCli(*cli.Context) (operations.Operation, error) // OperationFromConfig returns a new instance of that operation configured // as described by the opaque `operations.Configuration` structure. OperationFromConfig(operations.Configuration) (operations.Operation, error) }
OperationDescriptor describes an operation.
type OperationDescriptors ¶
type OperationDescriptors []OperationDescriptor
OperationDescriptors is a collection of OperationDescriptor.
var ( Index OperationDescriptors ByNameIndex = map[string]OperationDescriptor{} )
Index is the catalog of all known operations by name.
func (OperationDescriptors) Len ¶
func (d OperationDescriptors) Len() int
func (OperationDescriptors) Less ¶
func (d OperationDescriptors) Less(i, j int) bool
func (OperationDescriptors) Swap ¶
func (d OperationDescriptors) Swap(i, j int)
type OperationValidator ¶
type OperationValidator struct{}
OperationValidator validates an operation configuration.
func (OperationValidator) Validate ¶
func (o OperationValidator) Validate(operationConfig *configuration.OperationConfiguration) error
Validate verifies the validity of the configuration object.