domain

package
v0.0.0-...-431858b Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

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

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

func (b1 *Bucket) Equals(b2 *Bucket) bool

func (*Bucket) IsIdentical

func (b1 *Bucket) IsIdentical(b2 *Bucket) bool

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

func (BucketRegion) Value

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

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

func (BucketType) Value

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

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"`
}

func (*File) Equals

func (f1 *File) Equals(f2 *File) bool

func (*File) IsIdentical

func (f1 *File) IsIdentical(f2 *File) bool

Jump to

Keyboard shortcuts

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