Documentation
¶
Index ¶
- type ChangedSetting
- type ContainerID
- type IParameter
- type IParameterOption
- type Parameter
- func (p *Parameter[Type]) Deserialize(serializedParam string, network rptypes.Network) error
- func (p *Parameter[_]) GetCommon() *ParameterCommon
- func (p *Parameter[Type]) GetDefault(network rptypes.Network) (Type, error)
- func (p *Parameter[_]) GetOptions() []*ParameterOptionCommon
- func (p *Parameter[_]) GetValueAsString() string
- func (p *Parameter[_]) SetToDefault(network rptypes.Network) error
- type ParameterCommon
- type ParameterOption
- type ParameterOptionCommon
- type ParameterType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangedSetting ¶
type ChangedSetting struct {
Name string
OldValue string
NewValue string
AffectedContainers map[ContainerID]bool
}
A setting that has changed
type ContainerID ¶
type ContainerID string
A Docker container name
const ( ContainerID_Unknown ContainerID = "" ContainerID_Daemon ContainerID = "daemon" )
Enum to describe the names of Hyperdrive containers
type IParameter ¶
type IParameter interface {
// Get the parameter's common fields
GetCommon() *ParameterCommon
// Get the common fields from each ParameterOption (returns nil if this isn't a choice parameter)
GetOptions() []*ParameterOptionCommon
// Set the parameter to the default value
SetToDefault(network rptypes.Network) error
// Get the parameter's value as a string
GetValueAsString() string
// Deserializes a string into this parameter's value
Deserialize(serializedParam string, network rptypes.Network) error
}
An interface for typed Parameter structs, to get common fields from them
type IParameterOption ¶
type IParameterOption interface {
// Get the parameter option's common fields
Common() *ParameterOptionCommon
GetValueAsString() string
}
An interface for typed ParameterOption structs, to get common fields from them
type Parameter ¶
type Parameter[Type ParameterType] struct { *ParameterCommon Default map[rptypes.Network]Type Value Type Options []*ParameterOption[Type] }
A parameter that can be configured by the user
func (*Parameter[Type]) Deserialize ¶
Deserializes a string into this parameter's value
func (*Parameter[_]) GetCommon ¶
func (p *Parameter[_]) GetCommon() *ParameterCommon
Get the parameter's common fields
func (*Parameter[Type]) GetDefault ¶
Get the default value for the provided network
func (*Parameter[_]) GetOptions ¶
func (p *Parameter[_]) GetOptions() []*ParameterOptionCommon
Get the common fields from each ParameterOption (returns nil if this isn't a choice parameter)
func (*Parameter[_]) GetValueAsString ¶
Get the parameter's value as a string
type ParameterCommon ¶
type ParameterCommon struct {
// The parameter's ID, used for serialization and deserialization
ID string
// The parameter's human-readable name
Name string
// A description of this parameter / setting
Description string
// Whether or not this is a selection-type parameter with multiple options to choose from
IsChoice bool
// The max length of the parameter, in characters, if it's free-form input
MaxLength int
// An optional regex used to validate free-form input for the parameter
Regex string
// True if this is an advanced parameter and should be hidden unless advanced configuration mode is enabled
Advanced bool
// The list of Docker containers affected by changing this parameter
// (these containers will require a restart for the change to take effect)
AffectsContainers []ContainerID
// A list of Docker container environment variables that should be set to this parameter's value
EnvironmentVariables []string
// Whether or not the parameter is allowed to be blank
CanBeBlank bool
// True to reset the parameter's value to the default option after Hyperdrive is updated
OverwriteOnUpgrade bool
// Descriptions of the parameter that change depending on the selected network
DescriptionsByNetwork map[rptypes.Network]string
}
Common fields across all Parameter instances
type ParameterOption ¶
type ParameterOption[Type ParameterType] struct { *ParameterOptionCommon // The underlying value for this option Value Type }
A single option in a choice parameter
func (*ParameterOption[_]) Common ¶
func (p *ParameterOption[_]) Common() *ParameterOptionCommon
Get the parameter option's common fields
func (*ParameterOption[_]) GetValueAsString ¶
func (p *ParameterOption[_]) GetValueAsString() string
Get the parameter option's value as a string
type ParameterOptionCommon ¶
type ParameterOptionCommon struct {
// The option's human-readable name, to be used in config displays
Name string
// A description signifying what this option means
Description string
}
Common fields across all ParameterOption instances
type ParameterType ¶
Legal types for Parameters to use