values

package
v1.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var AllProtocols = []Protocol{
	TCP,
	Unix,
}

AllProtocols contains all possible variants of Protocol.

View Source
var AllRestartTypes = []RestartType{
	Never,
	OnFailures,
	Always,
}

AllRestartTypes contains all possible variants of RestartType.

View Source
var AllSignalTargets = []SignalTarget{
	Process,
	ProcessGroup,
	Mixed,
}

AllSignalTargets contains all possible variants of SignalTarget.

View Source
var NameToSignal = map[string]Signal{}

NameToSignal contains all possible variants of Signal names and their values

View Source
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

func IsDefaultValue(defaults map[string]interface{}, fieldName string, value interface{}) bool

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

func (instance Boolean) CheckedString() (string, error)

CheckedString is like String but also returns an optional error if there are any validation errors.

func (Boolean) MarshalYAML

func (instance Boolean) MarshalYAML() (interface{}, error)

MarshalYAML is used until yaml marshalling. Do not call this method directly.

func (*Boolean) Set

func (instance *Boolean) Set(value string) error

Set sets the given string to current object from a string.

func (*Boolean) SetFromBool

func (instance *Boolean) SetFromBool(value bool) error

SetFromBool sets the given boolean value to the current object.

func (Boolean) String

func (instance Boolean) String() string

func (*Boolean) UnmarshalYAML

func (instance *Boolean) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.

func (Boolean) Validate

func (instance Boolean) Validate() error

Validate validates actions on this object and returns an error object if there are any.

type ExitCode

type ExitCode int

ExitCode represents an exitCode of a command. @inline

func (ExitCode) MarshalYAML

func (i ExitCode) MarshalYAML() (interface{}, error)

MarshalYAML is used until yaml marshalling. Do not call this method directly.

func (*ExitCode) Set

func (i *ExitCode) 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 (ExitCode) String

func (i ExitCode) String() string

func (*ExitCode) UnmarshalYAML

func (i *ExitCode) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.

func (ExitCode) Validate

func (i ExitCode) Validate()

Validate validates actions on this object and returns an error object if there are any.

type ExitCodes

type ExitCodes []ExitCode

ExitCodes represents a couple of exitCodes. @inline

func (ExitCodes) Contains

func (i ExitCodes) Contains(what ExitCode) bool

Contains returns "true" if the given exitCode (what) is contained in this exitCodes.

func (*ExitCodes) Set

func (i *ExitCodes) 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 (ExitCodes) String

func (i ExitCodes) String() string

func (ExitCodes) Validate

func (i ExitCodes) Validate()

Validate validates actions on this object and returns an error object if there are any.

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

func (instance Integer) CheckedString() (string, error)

CheckedString is like String but return also an optional error if there are any validation errors.

func (Integer) Int

func (instance Integer) Int() int

Int returns this value as int.

func (Integer) MarshalYAML

func (instance Integer) MarshalYAML() (interface{}, error)

MarshalYAML is used until yaml marshalling. Do not call this method directly.

func (*Integer) Set

func (instance *Integer) 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 (*Integer) SetFromInt

func (instance *Integer) SetFromInt(value int) error

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) String

func (instance Integer) String() string

func (*Integer) UnmarshalYAML

func (instance *Integer) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.

func (Integer) Validate

func (instance Integer) Validate() error

Validate validates actions on this object and returns an error object if there are any.

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.

const (
	// TCP represents the TCP protocol type.
	TCP Protocol = 0
	// Unix represents a Unix socket files based protocol type.
	Unix Protocol = 1
)

func (Protocol) CheckedString

func (instance Protocol) CheckedString() (string, error)

CheckedString is like String but also returns an optional error if there are any validation errors.

func (Protocol) MarshalJSON

func (instance Protocol) MarshalJSON() ([]byte, error)

MarshalJSON is used until json marshalling. Do not call this method directly.

func (Protocol) MarshalYAML

func (instance Protocol) MarshalYAML() (interface{}, error)

MarshalYAML is used until yaml marshalling. Do not call this method directly.

func (*Protocol) Set

func (instance *Protocol) 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 (Protocol) String

func (instance Protocol) String() string

func (*Protocol) UnmarshalJSON

func (instance *Protocol) UnmarshalJSON(b []byte) error

UnmarshalJSON is used until json unmarshalling. Do not call this method directly.

func (*Protocol) UnmarshalYAML

func (instance *Protocol) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.

func (Protocol) Validate

func (instance Protocol) Validate() error

Validate validates actions on this object and returns an error object if there are any.

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

type Signal syscall.Signal

Signal represents an system signal. @inline

func (Signal) CheckedString

func (instance Signal) CheckedString() (string, error)

CheckedString is like String but also returns an optional error if there are any validation errors.

func (Signal) MarshalJSON

func (instance Signal) MarshalJSON() ([]byte, error)

MarshalJSON is used until json marshalling. Do not call this method directly.

func (Signal) MarshalYAML

func (instance Signal) MarshalYAML() (interface{}, error)

MarshalYAML is used until yaml marshalling. Do not call this method directly.

func (*Signal) Set

func (instance *Signal) 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 (Signal) String

func (instance Signal) String() string

func (*Signal) UnmarshalJSON

func (instance *Signal) UnmarshalJSON(b []byte) error

UnmarshalJSON is used until json unmarshalling. Do not call this method directly.

func (*Signal) UnmarshalYAML

func (instance *Signal) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.

func (Signal) Validate

func (instance Signal) Validate() error

Validate validates actions on this object and returns an error object if there are any.

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

type SocketAddress struct {
	Protocol Protocol
	Target   string
	Port     int
}

@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

func (instance String) CheckedString() (string, error)

CheckedString is like String but also returns an optional error if there are any validation errors.

func (String) IsEmpty

func (instance String) IsEmpty() bool

IsEmpty returns "true" if the current string instance has no content.

func (String) IsTrimmedEmpty

func (instance String) IsTrimmedEmpty() bool

IsTrimmedEmpty returns "true" if the current string instance has no trimmed content.

func (String) MarshalYAML

func (instance String) MarshalYAML() (interface{}, error)

MarshalYAML is used until yaml marshalling. Do not call this method directly.

func (*String) Set

func (instance *String) Set(value string) error

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) String

func (instance String) String() string

func (*String) UnmarshalYAML

func (instance *String) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is used until yaml unmarshalling. Do not call this method directly.

func (String) Validate

func (instance String) Validate() error

Validate validates actions on this object and returns an error object if there are any.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL