library

package
v0.0.0-...-35e449e Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Install go-enum by `go get install github.com/searKing/golang/tools/go-enum`

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PropertyTypeSliceContains

func PropertyTypeSliceContains(enums []PropertyType, sunEnums ...PropertyType) bool

PropertyTypeSliceContains reports whether sunEnums is within enums.

func PropertyTypeSliceContainsAny

func PropertyTypeSliceContainsAny(enums []PropertyType, sunEnums ...PropertyType) bool

PropertyTypeSliceContainsAny reports whether any sunEnum is within enums.

func ToProtoProperties

func ToProtoProperties(props map[string]PropertyType) map[string]proto.PropertyType

Types

type ArtifactType

type ArtifactType struct {
	MetadataType `yaml:",inline"`
}

type ContextType

type ContextType struct {
	MetadataType `yaml:",inline"`
}

type ExecutionType

type ExecutionType struct {
	MetadataType `yaml:",inline"`
}

type MetadataLibrary

type MetadataLibrary struct {
	ArtifactTypes  []ArtifactType  `yaml:"artifact-types,omitempty"`
	ContextTypes   []ContextType   `yaml:"context-types,omitempty"`
	ExecutionTypes []ExecutionType `yaml:"execution-types,omitempty"`
}

type MetadataType

type MetadataType struct {
	Name        *string                 `yaml:"name,omitempty"`
	Version     *string                 `yaml:"version,omitempty"`
	Description *string                 `yaml:"description,omitempty"`
	ExternalId  *string                 `yaml:"external_id,omitempty"`
	Properties  map[string]PropertyType `yaml:"properties,omitempty"`
}

type PropertyType

type PropertyType int32
const (
	UNKNOWN PropertyType = iota
	INT
	DOUBLE
	STRING
	STRUCT
	PROTO
	BOOLEAN
)

func ParsePropertyTypeString

func ParsePropertyTypeString(s string) (PropertyType, error)

ParsePropertyTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func PropertyTypeValues

func PropertyTypeValues() []PropertyType

PropertyTypeValues returns all values of the enum

func (PropertyType) MarshalBinary

func (i PropertyType) MarshalBinary() (data []byte, err error)

MarshalBinary implements the encoding.BinaryMarshaler interface for PropertyType

func (PropertyType) MarshalJSON

func (i PropertyType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for PropertyType

func (PropertyType) MarshalText

func (i PropertyType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for PropertyType

func (PropertyType) MarshalYAML

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

MarshalYAML implements a YAML Marshaler for PropertyType

func (PropertyType) New

func (i PropertyType) New() *PropertyType

New returns a pointer to a new addr filled with the PropertyType value passed in.

func (PropertyType) Registered

func (i PropertyType) Registered() bool

IsAPropertyType returns "true" if the value is listed in the enum definition. "false" otherwise

func (*PropertyType) Scan

func (i *PropertyType) Scan(value interface{}) error

func (PropertyType) String

func (i PropertyType) String() string

func (*PropertyType) UnmarshalBinary

func (i *PropertyType) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for PropertyType

func (*PropertyType) UnmarshalJSON

func (i *PropertyType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PropertyType

func (*PropertyType) UnmarshalText

func (i *PropertyType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for PropertyType

func (*PropertyType) UnmarshalYAML

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

UnmarshalYAML implements a YAML Unmarshaler for PropertyType

func (PropertyType) Value

func (i PropertyType) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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