Documentation ¶
Overview ¶
Install go-enum by `go get install github.com/searKing/golang/tools/go-enum`
Install go-enum by `go get install github.com/searKing/golang/tools/go-enum`
Index ¶
- func BucketRegionSliceContains(enums []BucketRegion, sunEnums ...BucketRegion) bool
- func BucketRegionSliceContainsAny(enums []BucketRegion, sunEnums ...BucketRegion) bool
- func BucketTypeSliceContains(enums []BucketType, sunEnums ...BucketType) bool
- func BucketTypeSliceContainsAny(enums []BucketType, sunEnums ...BucketType) bool
- type Bucket
- type BucketRegion
- func (i BucketRegion) MarshalBinary() (data []byte, err error)
- func (i BucketRegion) MarshalJSON() ([]byte, error)
- func (i BucketRegion) MarshalText() ([]byte, error)
- func (i BucketRegion) MarshalYAML() (interface{}, error)
- func (i BucketRegion) New() *BucketRegion
- func (i BucketRegion) Registered() bool
- func (i *BucketRegion) Scan(value interface{}) error
- func (i BucketRegion) String() string
- func (i *BucketRegion) UnmarshalBinary(data []byte) error
- func (i *BucketRegion) UnmarshalJSON(data []byte) error
- func (i *BucketRegion) UnmarshalText(text []byte) error
- func (i *BucketRegion) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i BucketRegion) Value() (driver.Value, error)
- type BucketType
- func (i BucketType) MarshalBinary() (data []byte, err error)
- func (i BucketType) MarshalJSON() ([]byte, error)
- func (i BucketType) MarshalText() ([]byte, error)
- func (i BucketType) MarshalYAML() (interface{}, error)
- func (i BucketType) New() *BucketType
- func (i BucketType) Registered() bool
- func (i *BucketType) Scan(value interface{}) error
- func (i BucketType) String() string
- func (i *BucketType) UnmarshalBinary(data []byte) error
- func (i *BucketType) UnmarshalJSON(data []byte) error
- func (i *BucketType) UnmarshalText(text []byte) error
- func (i *BucketType) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i BucketType) Value() (driver.Value, error)
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BucketRegionSliceContains ¶
func BucketRegionSliceContains(enums []BucketRegion, sunEnums ...BucketRegion) bool
BucketRegionSliceContains reports whether sunEnums is within enums.
func BucketRegionSliceContainsAny ¶
func BucketRegionSliceContainsAny(enums []BucketRegion, sunEnums ...BucketRegion) bool
BucketRegionSliceContainsAny reports whether any sunEnum is within enums.
func BucketTypeSliceContains ¶
func BucketTypeSliceContains(enums []BucketType, sunEnums ...BucketType) bool
BucketTypeSliceContains reports whether sunEnums is within enums.
func BucketTypeSliceContainsAny ¶
func BucketTypeSliceContainsAny(enums []BucketType, sunEnums ...BucketType) bool
BucketTypeSliceContainsAny reports whether any sunEnum is within enums.
Types ¶
type Bucket ¶
type Bucket struct { Name string `json:"name"` Region BucketRegion `json:"region"` Type BucketType `json:"type"` ID uuid.UUID `json:"id" db:"public_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (*Bucket) IsIdentical ¶
type BucketRegion ¶
type BucketRegion int
const ( BucketRegionInvalid BucketRegion = iota // invalid BucketRegionAPSouthEast1 // ap-southeast-1 BucketRegionAPSouthEast2 // ap-southeast-2 BucketRegionEUCentral1 // eu-central-1 BucketRegionEUWest2 // eu-west-2 BucketRegionLocal // local BucketRegionUSEast1 // us-east-1 BucketRegionUSWest1 // us-west-1 )
func BucketRegionValues ¶
func BucketRegionValues() []BucketRegion
BucketRegionValues returns all values of the enum
func ParseBucketRegionString ¶
func ParseBucketRegionString(s string) (BucketRegion, error)
ParseBucketRegionString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (BucketRegion) MarshalBinary ¶
func (i BucketRegion) MarshalBinary() (data []byte, err error)
MarshalBinary implements the encoding.BinaryMarshaler interface for BucketRegion
func (BucketRegion) MarshalJSON ¶
func (i BucketRegion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for BucketRegion
func (BucketRegion) MarshalText ¶
func (i BucketRegion) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for BucketRegion
func (BucketRegion) MarshalYAML ¶
func (i BucketRegion) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for BucketRegion
func (BucketRegion) New ¶
func (i BucketRegion) New() *BucketRegion
New returns a pointer to a new addr filled with the BucketRegion value passed in.
func (BucketRegion) Registered ¶
func (i BucketRegion) Registered() bool
IsABucketRegion returns "true" if the value is listed in the enum definition. "false" otherwise
func (*BucketRegion) Scan ¶
func (i *BucketRegion) Scan(value interface{}) error
func (BucketRegion) String ¶
func (i BucketRegion) String() string
func (*BucketRegion) UnmarshalBinary ¶
func (i *BucketRegion) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for BucketRegion
func (*BucketRegion) UnmarshalJSON ¶
func (i *BucketRegion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for BucketRegion
func (*BucketRegion) UnmarshalText ¶
func (i *BucketRegion) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for BucketRegion
func (*BucketRegion) UnmarshalYAML ¶
func (i *BucketRegion) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for BucketRegion
type BucketType ¶
type BucketType int
const ( BucketTypeInvalid BucketType = iota // invalid BucketTypeAWS //aws BucketTypeAzure // azure BucketTypeLocal // local BucketTypeOCI // oci )
func BucketTypeValues ¶
func BucketTypeValues() []BucketType
BucketTypeValues returns all values of the enum
func ParseBucketTypeString ¶
func ParseBucketTypeString(s string) (BucketType, error)
ParseBucketTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (BucketType) MarshalBinary ¶
func (i BucketType) MarshalBinary() (data []byte, err error)
MarshalBinary implements the encoding.BinaryMarshaler interface for BucketType
func (BucketType) MarshalJSON ¶
func (i BucketType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for BucketType
func (BucketType) MarshalText ¶
func (i BucketType) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for BucketType
func (BucketType) MarshalYAML ¶
func (i BucketType) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for BucketType
func (BucketType) New ¶
func (i BucketType) New() *BucketType
New returns a pointer to a new addr filled with the BucketType value passed in.
func (BucketType) Registered ¶
func (i BucketType) Registered() bool
IsABucketType returns "true" if the value is listed in the enum definition. "false" otherwise
func (*BucketType) Scan ¶
func (i *BucketType) Scan(value interface{}) error
func (BucketType) String ¶
func (i BucketType) String() string
func (*BucketType) UnmarshalBinary ¶
func (i *BucketType) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for BucketType
func (*BucketType) UnmarshalJSON ¶
func (i *BucketType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for BucketType
func (*BucketType) UnmarshalText ¶
func (i *BucketType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for BucketType
func (*BucketType) UnmarshalYAML ¶
func (i *BucketType) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for BucketType
type File ¶
type File struct { Name string `json:"name"` Size int64 `json:"size"` ID uuid.UUID `json:"id" db:"public_id"` BucketName string `json:"bucket_name"` MimeType string `json:"mime_type"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }