Documentation
¶
Index ¶
- Variables
- func ExhaustiveStatuses(f func(Status))
- type Status
- func (s Status) IsValid() bool
- func (s Status) MarshalBinary() ([]byte, error)
- func (s Status) MarshalJSON() ([]byte, error)
- func (s Status) MarshalText() ([]byte, error)
- func (s Status) MarshalYAML() ([]byte, error)
- func (s *Status) Scan(value any) error
- func (s Status) String() string
- func (s *Status) UnmarshalBinary(b []byte) error
- func (s *Status) UnmarshalJSON(b []byte) error
- func (s *Status) UnmarshalText(b []byte) error
- func (s *Status) UnmarshalYAML(b []byte) error
- func (s Status) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var ErrParseStatus = errors.New("invalid input provided to parse to Status")
var Statuses = statusesContainer{ UNKNOWN: Status{ // contains filtered or unexported fields }, FAILED: Status{ // contains filtered or unexported fields }, PASSED: Status{ // contains filtered or unexported fields }, SKIPPED: Status{ // contains filtered or unexported fields }, SCHEDULED: Status{ // contains filtered or unexported fields }, RUNNING: Status{ // contains filtered or unexported fields }, BOOKED: Status{ // contains filtered or unexported fields }, }
Statuses is a main entry point using the Status type. It it a container for all enum values and provides a convenient way to access all enum values and perform operations, with convenience methods for common use cases.
Functions ¶
func ExhaustiveStatuses ¶ added in v0.3.7
func ExhaustiveStatuses(f func(Status))
ExhaustiveStatuses iterates over all enum values and calls the provided function for each value. This function is useful for performing operations on all valid enum values in a loop.
Types ¶
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is a type that represents a single enum value. It combines the core information about the enum constant and it's defined fields.
func ParseStatus ¶ added in v0.2.4
ParseStatus parses the input value into an enum value. It returns the parsed enum value or an error if the input is invalid. It is a convenience function that can be used to parse enum values from various input types, such as strings, byte slices, or other enum types.
func (Status) IsValid ¶
IsValid checks whether the Statuses value is valid. A valid value is one that is defined in the original enum and not marked as invalid.
func (Status) MarshalBinary ¶ added in v0.3.8
MarshalBinary implements the encoding.BinaryMarshaler interface for Status. It returns the binary representation of the enum value as a byte slice.
func (Status) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Status. It returns the JSON representation of the enum value as a byte slice.
func (Status) MarshalText ¶ added in v0.3.8
MarshalText implements the encoding.TextMarshaler interface for Status. It returns the string representation of the enum value as a byte slice
func (Status) MarshalYAML ¶ added in v0.4.0
MarshalYAML implements the yaml.Marshaler interface for Status. It returns the string representation of the enum value.
func (*Status) Scan ¶ added in v0.2.4
Scan implements the database/sql.Scanner interface for Status. It parses the string representation of the enum value from the database row. It returns an error if the row does not contain a valid enum value.
func (Status) String ¶
String implements the Stringer interface. It returns the canonical absolute name of the enum value.
func (*Status) UnmarshalBinary ¶ added in v0.3.8
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Status. It parses the binary representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*Status) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Status. It parses the JSON representation of the enum value from the byte slice. It returns an error if the input is not a valid JSON representation.
func (*Status) UnmarshalText ¶ added in v0.3.8
UnmarshalText implements the encoding.TextUnmarshaler interface for Status. It parses the string representation of the enum value from the byte slice. It returns an error if the byte slice does not contain a valid enum value.
func (*Status) UnmarshalYAML ¶ added in v0.4.0
UnmarshalYAML implements the yaml.Unmarshaler interface for Planet. It parses the byte slice representation of the enum value and returns an error if the YAML byte slice does not contain a valid enum value.