Documentation ¶
Overview ¶
Install go-enum by `go get install github.com/searKing/golang/tools/go-enum`
Index ¶
- func PropertyTypeSliceContains(enums []PropertyType, sunEnums ...PropertyType) bool
- func PropertyTypeSliceContainsAny(enums []PropertyType, sunEnums ...PropertyType) bool
- func ToProtoProperties(props map[string]PropertyType) map[string]proto.PropertyType
- type ArtifactType
- type ContextType
- type ExecutionType
- type MetadataLibrary
- type MetadataType
- type PropertyType
- func (i PropertyType) MarshalBinary() (data []byte, err error)
- func (i PropertyType) MarshalJSON() ([]byte, error)
- func (i PropertyType) MarshalText() ([]byte, error)
- func (i PropertyType) MarshalYAML() (interface{}, error)
- func (i PropertyType) New() *PropertyType
- func (i PropertyType) Registered() bool
- func (i *PropertyType) Scan(value interface{}) error
- func (i PropertyType) String() string
- func (i *PropertyType) UnmarshalBinary(data []byte) error
- func (i *PropertyType) UnmarshalJSON(data []byte) error
- func (i *PropertyType) UnmarshalText(text []byte) error
- func (i *PropertyType) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i PropertyType) Value() (driver.Value, error)
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 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