Documentation ¶
Index ¶
- Constants
- Variables
- func IsDefaultReflectValue(defaults map[string]interface{}, field reflect.StructField, ...) bool
- func IsDefaultValue(defaults map[string]interface{}, fieldName string, value interface{}) bool
- func SetDefaultsTo(defaults map[string]interface{}, to interface{}) interface{}
- type Boolean
- func (instance Boolean) CheckedString() (string, error)
- func (instance Boolean) MarshalYAML() (interface{}, error)
- func (instance *Boolean) Set(value string) error
- func (instance *Boolean) SetFromBool(value bool) error
- func (instance Boolean) String() string
- func (instance *Boolean) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (instance Boolean) Validate() error
- type ExitCode
- type ExitCodes
- type Integer
- func (instance Integer) CheckedString() (string, error)
- func (instance Integer) Int() int
- func (instance Integer) MarshalYAML() (interface{}, error)
- func (instance *Integer) Set(value string) error
- func (instance *Integer) SetFromInt(value int) error
- func (instance Integer) String() string
- func (instance *Integer) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (instance Integer) Validate() error
- type NonNegativeInteger
- func (i NonNegativeInteger) CheckedString() (string, error)
- func (i NonNegativeInteger) Int() int
- func (i NonNegativeInteger) MarshalYAML() (interface{}, error)
- func (i *NonNegativeInteger) Set(value string) error
- func (i *NonNegativeInteger) SetFromInt(value int) error
- func (i NonNegativeInteger) String() string
- func (i *NonNegativeInteger) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i NonNegativeInteger) Validate() error
- type Protocol
- func (instance Protocol) CheckedString() (string, error)
- func (instance Protocol) MarshalJSON() ([]byte, error)
- func (instance Protocol) MarshalYAML() (interface{}, error)
- func (instance *Protocol) Set(value string) error
- func (instance Protocol) String() string
- func (instance *Protocol) UnmarshalJSON(b []byte) error
- func (instance *Protocol) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (instance Protocol) Validate() error
- type RestartType
- func (instance RestartType) CheckedString() (string, error)
- func (instance RestartType) MarshalJSON() ([]byte, error)
- func (instance RestartType) MarshalYAML() (interface{}, error)
- func (instance RestartType) OnFailures() bool
- func (instance RestartType) OnSuccess() bool
- func (instance *RestartType) Set(value string) error
- func (instance RestartType) String() string
- func (instance *RestartType) UnmarshalJSON(b []byte) error
- func (instance *RestartType) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (instance RestartType) Validate() error
- type Signal
- func (instance Signal) CheckedString() (string, error)
- func (instance Signal) MarshalJSON() ([]byte, error)
- func (instance Signal) MarshalYAML() (interface{}, error)
- func (instance *Signal) Set(value string) error
- func (instance Signal) String() string
- func (instance *Signal) UnmarshalJSON(b []byte) error
- func (instance *Signal) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (instance Signal) Validate() error
- type SignalTarget
- func (instance SignalTarget) CheckedString() (string, error)
- func (instance SignalTarget) MarshalJSON() ([]byte, error)
- func (instance SignalTarget) MarshalYAML() (interface{}, error)
- func (instance *SignalTarget) Set(value string) error
- func (instance SignalTarget) String() string
- func (instance *SignalTarget) UnmarshalJSON(b []byte) error
- func (instance *SignalTarget) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (instance SignalTarget) Validate() error
- type SocketAddress
- func (instance SocketAddress) AsAddress() string
- func (instance SocketAddress) AsScheme() string
- func (instance SocketAddress) CheckedString() (string, error)
- func (instance SocketAddress) MarshalYAML() (interface{}, error)
- func (instance *SocketAddress) Set(value string) error
- func (instance *SocketAddress) SetTCP(value string) error
- func (instance *SocketAddress) SetUnix(value string) error
- func (instance SocketAddress) String() string
- func (instance *SocketAddress) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (instance SocketAddress) Validate() error
- type String
- func (instance String) CheckedString() (string, error)
- func (instance String) IsEmpty() bool
- func (instance String) IsTrimmedEmpty() bool
- func (instance String) MarshalYAML() (interface{}, error)
- func (instance *String) Set(value string) error
- func (instance String) String() string
- func (instance *String) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (instance String) Validate() error
Constants ¶
const ( // NOOP represents the system signal NOOP NOOP = Signal(0x0) // ABRT represents the system signal ABRT ABRT = Signal(0x6) // ALRM represents the system signal ALRM ALRM = Signal(0xe) // BUS represents the system signal BUS BUS = Signal(0x7) // CHLD represents the system signal CHLD CHLD = Signal(0x11) // CONT represents the system signal CONT CONT = Signal(0x12) // FPE represents the system signal FPE FPE = Signal(0x8) // HUP represents the system signal HUP HUP = Signal(0x1) // ILL represents the system signal ILL ILL = Signal(0x4) // INT represents the system signal INT INT = Signal(0x2) // IO represents the system signal IO IO = Signal(0x1d) // KILL represents the system signal KILL KILL = Signal(0x9) // PIPE represents the system signal PIPE PIPE = Signal(0xd) // PROF represents the system signal PROF PROF = Signal(0x1b) // PWR represents the system signal PWR PWR = Signal(0x1e) // QUIT represents the system signal QUIT QUIT = Signal(0x3) // SEGV represents the system signal SEGV SEGV = Signal(0xb) // STKFLT represents the system signal STKFLT STKFLT = Signal(0x10) // STOP represents the system signal STOP STOP = Signal(0x13) // SYS represents the system signal SYS SYS = Signal(0x1f) // TERM represents the system signal TERM TERM = Signal(0xf) // TRAP represents the system signal TRAP TRAP = Signal(0x5) // TSTP represents the system signal TSTP TSTP = Signal(0x14) // TTIN represents the system signal TTIN TTIN = Signal(0x15) // TTOU represents the system signal TTOU TTOU = Signal(0x16) // URG represents the system signal URG URG = Signal(0x17) // USR1 represents the system signal USR1 USR1 = Signal(0xa) // USR2 represents the system signal USR2 USR2 = Signal(0xc) // VTALRM represents the system signal VTALRM VTALRM = Signal(0x1a) // WINCH represents the system signal WINCH WINCH = Signal(0x1c) // XCPU represents the system signal XCPU XCPU = Signal(0x18) // XFSZ represents the system signal XFSZ XFSZ = Signal(0x19) )
Variables ¶
var AllProtocols = []Protocol{ TCP, Unix, }
AllProtocols contains all possible variants of Protocol.
var AllRestartTypes = []RestartType{ Never, OnFailures, Always, }
AllRestartTypes contains all possible variants of RestartType.
var AllSignalTargets = []SignalTarget{ Process, ProcessGroup, Mixed, }
AllSignalTargets contains all possible variants of SignalTarget.
var NameToSignal = map[string]Signal{}
NameToSignal contains all possible variants of Signal names and their values
var SignalToName = map[Signal]string{ NOOP: "NOOP", ABRT: "ABRT", ALRM: "ALRM", BUS: "BUS", CHLD: "CHLD", CONT: "CONT", FPE: "FPE", HUP: "HUP", ILL: "ILL", INT: "INT", IO: "IO", KILL: "KILL", PIPE: "PIPE", PROF: "PROF", PWR: "PWR", QUIT: "QUIT", SEGV: "SEGV", STKFLT: "STKFLT", STOP: "STOP", SYS: "SYS", TERM: "TERM", TRAP: "TRAP", TSTP: "TSTP", TTIN: "TTIN", TTOU: "TTOU", URG: "URG", USR1: "USR1", USR2: "USR2", VTALRM: "VTALRM", WINCH: "WINCH", XCPU: "XCPU", XFSZ: "XFSZ", }
SignalToName contains all possible variants of Signal and their names
Functions ¶
func IsDefaultReflectValue ¶
func IsDefaultReflectValue(defaults map[string]interface{}, field reflect.StructField, value reflect.Value) bool
IsDefaultReflectValue checks whether if the given field in the given defaults map has the same value as the given one.
func IsDefaultValue ¶
IsDefaultValue checks whether the given fieldName in the given defaults map has the same value as the given one.
func SetDefaultsTo ¶
func SetDefaultsTo(defaults map[string]interface{}, to interface{}) interface{}
SetDefaultsTo applies defaults from the given defaults map to the given object.
Types ¶
type Boolean ¶
type Boolean bool
Boolean represents a boolean with more features as the primitive type. @inline
func (Boolean) CheckedString ¶
CheckedString is like String but also returns an optional error if there are any validation errors.
func (Boolean) MarshalYAML ¶
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*Boolean) SetFromBool ¶
SetFromBool sets the given boolean value to the current object.
func (*Boolean) UnmarshalYAML ¶
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
type ExitCode ¶
type ExitCode int
ExitCode represents an exitCode of a command. @inline
func (ExitCode) MarshalYAML ¶
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*ExitCode) Set ¶
Set sets the given string to current object from a string. Returns an error object if there are any problems while transforming the string.
func (*ExitCode) UnmarshalYAML ¶
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
type ExitCodes ¶
type ExitCodes []ExitCode
ExitCodes represents a couple of exitCodes. @inline
func (ExitCodes) Contains ¶
Contains returns "true" if the given exitCode (what) is contained in this exitCodes.
type Integer ¶
type Integer int
Integer represents an int with more features as the primitive type. @inline
func (Integer) CheckedString ¶ added in v0.1.6
CheckedString is like String but return also an optional error if there are any validation errors.
func (Integer) MarshalYAML ¶
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*Integer) Set ¶
Set sets the given string to current object from a string. Returns an error object if there are any problems while transforming the string.
func (*Integer) SetFromInt ¶
SetFromInt tries to set the given int value to this instance. Returns an error object if there are some problems while transforming the plain int.
func (*Integer) UnmarshalYAML ¶
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
type NonNegativeInteger ¶
type NonNegativeInteger int
NonNegativeInteger represents an int with more features as the primitive type and that could not be negative. @inline
func (NonNegativeInteger) CheckedString ¶
func (i NonNegativeInteger) CheckedString() (string, error)
CheckedString is like String but also returns also an optional error if there are any validation errors.
func (NonNegativeInteger) Int ¶
func (i NonNegativeInteger) Int() int
Int returns this value as int.
func (NonNegativeInteger) MarshalYAML ¶
func (i NonNegativeInteger) MarshalYAML() (interface{}, error)
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*NonNegativeInteger) Set ¶
func (i *NonNegativeInteger) Set(value string) error
Set sets the given string to current object from a string. Returns an error object if there are any problems while transforming the string.
func (*NonNegativeInteger) SetFromInt ¶
func (i *NonNegativeInteger) SetFromInt(value int) error
SetFromInt tries to set the given int value to this instance. Returns an error object if there are any problems while transforming the plain int.
func (NonNegativeInteger) String ¶
func (i NonNegativeInteger) String() string
func (*NonNegativeInteger) UnmarshalYAML ¶
func (i *NonNegativeInteger) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
func (NonNegativeInteger) Validate ¶
func (i NonNegativeInteger) Validate() error
Validate validates actions on this object and returns an error object if there are any.
type Protocol ¶
type Protocol int
Protocol represents a type of an protocol.
func (Protocol) CheckedString ¶
CheckedString is like String but also returns an optional error if there are any validation errors.
func (Protocol) MarshalJSON ¶
MarshalJSON is used until json marshalling. Do not call this method directly.
func (Protocol) MarshalYAML ¶
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*Protocol) Set ¶
Set sets the given string to current object from a string. Returns an error object if there are any problems while transforming the string.
func (*Protocol) UnmarshalJSON ¶
UnmarshalJSON is used until json unmarshalling. Do not call this method directly.
func (*Protocol) UnmarshalYAML ¶
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
type RestartType ¶
type RestartType int
Description ¶
RestartType tells caretakerd what to do if a process ends.
const ( // @id never // Never restart the process. Never RestartType = 0 // @id onFailures // Only restart the process on failures. OnFailures RestartType = 1 // @id always // Always restart the process. This means on success and on failures. Always RestartType = 2 )
func (RestartType) CheckedString ¶
func (instance RestartType) CheckedString() (string, error)
CheckedString is like String but also returns an optional error if there are any validation errors.
func (RestartType) MarshalJSON ¶
func (instance RestartType) MarshalJSON() ([]byte, error)
MarshalJSON is used until json marshalling. Do not call this method directly.
func (RestartType) MarshalYAML ¶
func (instance RestartType) MarshalYAML() (interface{}, error)
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (RestartType) OnFailures ¶
func (instance RestartType) OnFailures() bool
OnFailures returns "true" of the current RestartType tells to restart on failures.
func (RestartType) OnSuccess ¶
func (instance RestartType) OnSuccess() bool
OnSuccess returns "true" of the current RestartType tells to restart on success.
func (*RestartType) Set ¶
func (instance *RestartType) Set(value string) error
Set sets the given string to current object from a string. Returns an error object if there are any problems while transforming the string.
func (RestartType) String ¶
func (instance RestartType) String() string
func (*RestartType) UnmarshalJSON ¶
func (instance *RestartType) UnmarshalJSON(b []byte) error
UnmarshalJSON is used until json unmarshalling. Do not call this method directly.
func (*RestartType) UnmarshalYAML ¶
func (instance *RestartType) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
func (RestartType) Validate ¶
func (instance RestartType) Validate() error
Validate validates actions on this object and returns an error object if there are any.
type Signal ¶
Signal represents an system signal. @inline
func (Signal) CheckedString ¶
CheckedString is like String but also returns an optional error if there are any validation errors.
func (Signal) MarshalJSON ¶
MarshalJSON is used until json marshalling. Do not call this method directly.
func (Signal) MarshalYAML ¶
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*Signal) Set ¶
Set sets the given string to current object from a string. Returns an error object if there are any problems while transforming the string.
func (*Signal) UnmarshalJSON ¶
UnmarshalJSON is used until json unmarshalling. Do not call this method directly.
func (*Signal) UnmarshalYAML ¶
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
type SignalTarget ¶ added in v0.1.6
type SignalTarget int
SignalTarget defines who have to receives a signal.
const ( // @id process // // Send a signal to the process only. Process SignalTarget = 1 // @id processGroup // // Send a signal to the whole process group. ProcessGroup SignalTarget = 2 // @id mixed // // Send every signal only to a process - except KILL and STOP. This are send to the processGroup. Mixed SignalTarget = 3 )
func (SignalTarget) CheckedString ¶ added in v0.1.6
func (instance SignalTarget) CheckedString() (string, error)
CheckedString is like String but also returns an optional error if there are any validation errors.
func (SignalTarget) MarshalJSON ¶ added in v0.1.6
func (instance SignalTarget) MarshalJSON() ([]byte, error)
MarshalJSON is used until json marshalling. Do not call this method directly.
func (SignalTarget) MarshalYAML ¶ added in v0.1.6
func (instance SignalTarget) MarshalYAML() (interface{}, error)
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*SignalTarget) Set ¶ added in v0.1.6
func (instance *SignalTarget) Set(value string) error
Set sets the given string to current object from a string. Returns an error object if there are any problems while transforming the string.
func (SignalTarget) String ¶ added in v0.1.6
func (instance SignalTarget) String() string
func (*SignalTarget) UnmarshalJSON ¶ added in v0.1.6
func (instance *SignalTarget) UnmarshalJSON(b []byte) error
UnmarshalJSON is used until json unmarshalling. Do not call this method directly.
func (*SignalTarget) UnmarshalYAML ¶ added in v0.1.6
func (instance *SignalTarget) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
func (SignalTarget) Validate ¶ added in v0.1.6
func (instance SignalTarget) Validate() error
Validate validates actions on this object and returns an error object if there are any.
type SocketAddress ¶
@serializedAs string # Description
SocketAddress represents a socket address in the format “<protocol>://<target>“.
Protocols ¶
- **“tcp“** This address connects or binds to a TCP socket. The “target“ should be of format “<host>:<port>“.<br> Examples:
- “tcp://localhost:57955“: Listen on IPv4 and IPv6 local addresses
- “tcp://[::1]:57955“: Listen on IPv6 local address
- “tcp://0.0.0.0:57955“: Listen on all addresses - this includes IPv4 and IPv6
- “tcp://192.168.0.1:57955“: Listen on specific IPv4 address
- **“unix“** This address connects or binds to a UNIX file socket. The “target“ should be the location of the socket file.<br> Example:
- “unix:///var/run/caretakerd.sock“
func (SocketAddress) AsAddress ¶
func (instance SocketAddress) AsAddress() string
AsAddress returns a string that represents this SocketAddress as socket address.
func (SocketAddress) AsScheme ¶
func (instance SocketAddress) AsScheme() string
AsScheme returns a string that represents this SocketAddress as scheme.
func (SocketAddress) CheckedString ¶
func (instance SocketAddress) CheckedString() (string, error)
CheckedString is like String but also returns an optional error if there are any validation errors.
func (SocketAddress) MarshalYAML ¶
func (instance SocketAddress) MarshalYAML() (interface{}, error)
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*SocketAddress) Set ¶
func (instance *SocketAddress) Set(value string) error
Set sets the given string to current object from a string. Returns an error object if there are any problems while transforming the string.
func (*SocketAddress) SetTCP ¶ added in v0.1.6
func (instance *SocketAddress) SetTCP(value string) error
SetTCP set this SocketAddress instance to the given TCP address (without leadning tcp:// scheme)
func (*SocketAddress) SetUnix ¶
func (instance *SocketAddress) SetUnix(value string) error
SetUnix set this SocketAddress instance to the given Unix socket file (without leadning unix:// scheme)
func (SocketAddress) String ¶
func (instance SocketAddress) String() string
func (*SocketAddress) UnmarshalYAML ¶
func (instance *SocketAddress) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.
func (SocketAddress) Validate ¶
func (instance SocketAddress) Validate() error
Validate validates actions on this object and returns an error object if there are any.
type String ¶
type String string
String represents a string with more features as the primitive type. @inline
func (String) CheckedString ¶
CheckedString is like String but also returns an optional error if there are any validation errors.
func (String) IsTrimmedEmpty ¶
IsTrimmedEmpty returns "true" if the current string instance has no trimmed content.
func (String) MarshalYAML ¶
MarshalYAML is used until yaml marshalling. Do not call this method directly.
func (*String) Set ¶
Set sets the given string to the current object from a string. Returns an error object if there are any problems while transforming the string.
func (*String) UnmarshalYAML ¶
UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.