example

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeNames added in v0.1.4

func MakeNames() []string

MakeNames returns a list of possible string values of Make.

func NoZerosNames added in v0.1.4

func NoZerosNames() []string

NoZerosNames returns a list of possible string values of NoZeros.

func ParseOceanColorExample added in v0.3.2

func ParseOceanColorExample() bool

Additional template

func ParseOceanColorGlobbedExample added in v0.3.2

func ParseOceanColorGlobbedExample() bool

func ParseOceanColorGlobbedExample2 added in v0.3.2

func ParseOceanColorGlobbedExample2() bool

Types

type Animal

type Animal int32

Animal x ENUM( Cat, Dog, Fish )

const (
	// AnimalCat is a Animal of type Cat.
	AnimalCat Animal = iota
	// AnimalDog is a Animal of type Dog.
	AnimalDog
	// AnimalFish is a Animal of type Fish.
	AnimalFish
)

func ParseAnimal

func ParseAnimal(name string) (Animal, error)

ParseAnimal attempts to convert a string to a Animal

func (Animal) String

func (x Animal) String() string

String implements the Stringer interface.

type Color

type Color int

Color is an enumeration of colors that are allowed.

ENUM(

Black, White, Red Green = 33 // Green starts with 33

Blue grey= yellow blue-green red-orange yellow_green red-orange-blue )

const (
	// ColorBlack is a Color of type Black.
	ColorBlack Color = iota
	// ColorWhite is a Color of type White.
	ColorWhite
	// ColorRed is a Color of type Red.
	ColorRed
	// ColorGreen is a Color of type Green.
	// Green starts with 33
	ColorGreen Color = iota + 30
	// ColorBlue is a Color of type Blue.
	ColorBlue
	// ColorGrey is a Color of type Grey.
	ColorGrey
	// ColorYellow is a Color of type Yellow.
	ColorYellow
	// ColorBlueGreen is a Color of type Blue-Green.
	ColorBlueGreen
	// ColorRedOrange is a Color of type Red-Orange.
	ColorRedOrange
	// ColorYellowGreen is a Color of type Yellow_green.
	ColorYellowGreen
	// ColorRedOrangeBlue is a Color of type Red-Orange-Blue.
	ColorRedOrangeBlue
)

func ParseColor

func ParseColor(name string) (Color, error)

ParseColor attempts to convert a string to a Color

func (Color) MarshalText

func (x Color) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (Color) Ptr added in v0.3.0

func (x Color) Ptr() *Color

func (Color) String

func (x Color) String() string

String implements the Stringer interface.

func (*Color) UnmarshalText

func (x *Color) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type Commented added in v0.1.5

type Commented int

Commented is an enumeration of commented values

ENUM( value1 // Commented value 1 value2 value3 // Commented value 3 )

const (
	// CommentedValue1 is a Commented of type Value1.
	// Commented value 1
	CommentedValue1 Commented = iota
	// CommentedValue2 is a Commented of type Value2.
	CommentedValue2
	// CommentedValue3 is a Commented of type Value3.
	// Commented value 3
	CommentedValue3
)

func ParseCommented added in v0.1.5

func ParseCommented(name string) (Commented, error)

ParseCommented attempts to convert a string to a Commented

func (Commented) MarshalText added in v0.1.5

func (x Commented) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (Commented) String added in v0.1.5

func (x Commented) String() string

String implements the Stringer interface.

func (*Commented) UnmarshalText added in v0.1.5

func (x *Commented) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type ComplexCommented added in v0.1.6

type ComplexCommented int

ComplexCommented has some extra complicated parsing rules.

ENUM(

_, // Placeholder with a ','  in it. (for harder testing)

value1 // Commented value 1 value2, value3 // Commented value 3 )

const (

	// ComplexCommentedValue1 is a ComplexCommented of type Value1.
	// Commented value 1
	ComplexCommentedValue1 ComplexCommented
	// ComplexCommentedValue2 is a ComplexCommented of type Value2.
	ComplexCommentedValue2
	// ComplexCommentedValue3 is a ComplexCommented of type Value3.
	// Commented value 3
	ComplexCommentedValue3
)

func ParseComplexCommented added in v0.1.6

func ParseComplexCommented(name string) (ComplexCommented, error)

ParseComplexCommented attempts to convert a string to a ComplexCommented

func (ComplexCommented) MarshalText added in v0.1.6

func (x ComplexCommented) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (ComplexCommented) String added in v0.1.6

func (x ComplexCommented) String() string

String implements the Stringer interface.

func (*ComplexCommented) UnmarshalText added in v0.1.6

func (x *ComplexCommented) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type ImageType added in v0.3.0

type ImageType int

ENUM(jpeg, jpg, png, tiff, gif)

const (
	// ImageTypeJpeg is a ImageType of type Jpeg.
	ImageTypeJpeg ImageType = iota
	// ImageTypeJpg is a ImageType of type Jpg.
	ImageTypeJpg
	// ImageTypePng is a ImageType of type Png.
	ImageTypePng
	// ImageTypeTiff is a ImageType of type Tiff.
	ImageTypeTiff
	// ImageTypeGif is a ImageType of type Gif.
	ImageTypeGif
)

func ParseImageType added in v0.3.0

func ParseImageType(name string) (ImageType, error)

ParseImageType attempts to convert a string to a ImageType

func (*ImageType) Scan added in v0.3.0

func (x *ImageType) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (ImageType) String added in v0.3.0

func (x ImageType) String() string

String implements the Stringer interface.

func (ImageType) Value added in v0.3.0

func (x ImageType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type JobState added in v0.3.0

type JobState int

ENUM(pending, processing, completed, failed)

const (
	// JobStatePending is a JobState of type Pending.
	JobStatePending JobState = iota
	// JobStateProcessing is a JobState of type Processing.
	JobStateProcessing
	// JobStateCompleted is a JobState of type Completed.
	JobStateCompleted
	// JobStateFailed is a JobState of type Failed.
	JobStateFailed
)

func ParseJobState added in v0.3.0

func ParseJobState(name string) (JobState, error)

ParseJobState attempts to convert a string to a JobState

func (*JobState) Scan added in v0.3.0

func (x *JobState) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (JobState) String added in v0.3.0

func (x JobState) String() string

String implements the Stringer interface.

func (JobState) Value added in v0.3.0

func (x JobState) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Make added in v0.1.3

type Make int32

Make x ENUM(Toyota,_,Chevy,_,Ford,_,Tesla,_,Hyundai,_,Nissan,_,Jaguar,_,Audi,_,BMW,_,Mercedes-Benz,_,Volkswagon)

const (
	// MakeToyota is a Make of type Toyota.
	MakeToyota Make = iota

	// MakeChevy is a Make of type Chevy.
	MakeChevy

	// MakeFord is a Make of type Ford.
	MakeFord

	// MakeTesla is a Make of type Tesla.
	MakeTesla

	// MakeHyundai is a Make of type Hyundai.
	MakeHyundai

	// MakeNissan is a Make of type Nissan.
	MakeNissan

	// MakeJaguar is a Make of type Jaguar.
	MakeJaguar

	// MakeAudi is a Make of type Audi.
	MakeAudi

	// MakeBMW is a Make of type BMW.
	MakeBMW

	// MakeMercedesBenz is a Make of type Mercedes-Benz.
	MakeMercedesBenz

	// MakeVolkswagon is a Make of type Volkswagon.
	MakeVolkswagon
)

func ParseMake added in v0.1.3

func ParseMake(name string) (Make, error)

ParseMake attempts to convert a string to a Make

func (*Make) Get added in v0.1.3

func (x *Make) Get() interface{}

Get implements the Golang flag.Getter interface func.

func (Make) MarshalText added in v0.1.3

func (x Make) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (*Make) Set added in v0.1.3

func (x *Make) Set(val string) error

Set implements the Golang flag.Value interface func.

func (Make) String added in v0.1.3

func (x Make) String() string

String implements the Stringer interface.

func (*Make) Type added in v0.1.3

func (x *Make) Type() string

Type implements the github.com/spf13/pFlag Value interface.

func (*Make) UnmarshalText added in v0.1.3

func (x *Make) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type NoZeros added in v0.1.4

type NoZeros int32

Make x ENUM(start=20,middle,end,ps,pps,ppps)

const (
	// NoZerosStart is a NoZeros of type Start.
	NoZerosStart NoZeros = iota + 20
	// NoZerosMiddle is a NoZeros of type Middle.
	NoZerosMiddle
	// NoZerosEnd is a NoZeros of type End.
	NoZerosEnd
	// NoZerosPs is a NoZeros of type Ps.
	NoZerosPs
	// NoZerosPps is a NoZeros of type Pps.
	NoZerosPps
	// NoZerosPpps is a NoZeros of type Ppps.
	NoZerosPpps
)

func ParseNoZeros added in v0.1.4

func ParseNoZeros(name string) (NoZeros, error)

ParseNoZeros attempts to convert a string to a NoZeros

func (*NoZeros) Get added in v0.1.4

func (x *NoZeros) Get() interface{}

Get implements the Golang flag.Getter interface func.

func (NoZeros) MarshalText added in v0.1.4

func (x NoZeros) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (*NoZeros) Set added in v0.1.4

func (x *NoZeros) Set(val string) error

Set implements the Golang flag.Value interface func.

func (NoZeros) String added in v0.1.4

func (x NoZeros) String() string

String implements the Stringer interface.

func (*NoZeros) Type added in v0.1.4

func (x *NoZeros) Type() string

Type implements the github.com/spf13/pFlag Value interface.

func (*NoZeros) UnmarshalText added in v0.1.4

func (x *NoZeros) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type NullImageType added in v0.3.0

type NullImageType struct {
	ImageType ImageType
	Valid     bool
}

func NewNullImageType added in v0.3.0

func NewNullImageType(val interface{}) (x NullImageType)

func (*NullImageType) Scan added in v0.3.0

func (x *NullImageType) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (NullImageType) Value added in v0.3.0

func (x NullImageType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullJobState added in v0.3.0

type NullJobState struct {
	JobState JobState
	Valid    bool
}

func NewNullJobState added in v0.3.0

func NewNullJobState(val interface{}) (x NullJobState)

func (*NullJobState) Scan added in v0.3.0

func (x *NullJobState) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (NullJobState) Value added in v0.3.0

func (x NullJobState) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullProjectStatus added in v0.3.0

type NullProjectStatus struct {
	ProjectStatus ProjectStatus
	Valid         bool
	Set           bool
}

func NewNullProjectStatus added in v0.3.0

func NewNullProjectStatus(val interface{}) (x NullProjectStatus)

func (NullProjectStatus) MarshalJSON added in v0.3.0

func (n NullProjectStatus) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullProjectStatus to JSON.

func (*NullProjectStatus) Scan added in v0.3.0

func (x *NullProjectStatus) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (*NullProjectStatus) UnmarshalJSON added in v0.3.0

func (n *NullProjectStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullProjectStatus from JSON.

func (NullProjectStatus) Value added in v0.3.0

func (x NullProjectStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullProjectStatusStr added in v0.3.0

type NullProjectStatusStr struct {
	NullProjectStatus
}

func NewNullProjectStatusStr added in v0.3.0

func NewNullProjectStatusStr(val interface{}) (x NullProjectStatusStr)

func (NullProjectStatusStr) MarshalJSON added in v0.3.0

func (n NullProjectStatusStr) MarshalJSON() ([]byte, error)

MarshalJSON correctly serializes a NullProjectStatus to JSON.

func (*NullProjectStatusStr) UnmarshalJSON added in v0.3.0

func (n *NullProjectStatusStr) UnmarshalJSON(b []byte) error

UnmarshalJSON correctly deserializes a NullProjectStatus from JSON.

func (NullProjectStatusStr) Value added in v0.3.0

func (x NullProjectStatusStr) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type OceanColor added in v0.3.2

type OceanColor int

OceanColor is an enumeration of ocean colors that are allowed.

ENUM( Cerulean Blue Green )

const (
	// OceanColorCerulean is a OceanColor of type Cerulean.
	OceanColorCerulean OceanColor = iota
	// OceanColorBlue is a OceanColor of type Blue.
	OceanColorBlue
	// OceanColorGreen is a OceanColor of type Green.
	OceanColorGreen
)

func ParseOceanColor added in v0.3.2

func ParseOceanColor(name string) (OceanColor, error)

ParseOceanColor attempts to convert a string to a OceanColor

func (OceanColor) String added in v0.3.2

func (x OceanColor) String() string

String implements the Stringer interface.

type Product added in v0.2.3

type Product int32

Products of AcmeInc ENUM( Anvil, Dynamite, Glue )

const (
	// AcmeIncProductAnvil is a Product of type Anvil.
	AcmeIncProductAnvil Product = iota
	// AcmeIncProductDynamite is a Product of type Dynamite.
	AcmeIncProductDynamite
	// AcmeIncProductGlue is a Product of type Glue.
	AcmeIncProductGlue
)

func ParseProduct added in v0.2.3

func ParseProduct(name string) (Product, error)

ParseProduct attempts to convert a string to a Product

func (Product) String added in v0.2.3

func (x Product) String() string

String implements the Stringer interface.

type ProjectStatus added in v0.1.5

type ProjectStatus int

ENUM(pending, inWork, completed, rejected)

const (
	// ProjectStatusPending is a ProjectStatus of type Pending.
	ProjectStatusPending ProjectStatus = iota
	// ProjectStatusInWork is a ProjectStatus of type InWork.
	ProjectStatusInWork
	// ProjectStatusCompleted is a ProjectStatus of type Completed.
	ProjectStatusCompleted
	// ProjectStatusRejected is a ProjectStatus of type Rejected.
	ProjectStatusRejected
)

func ParseProjectStatus added in v0.1.5

func ParseProjectStatus(name string) (ProjectStatus, error)

ParseProjectStatus attempts to convert a string to a ProjectStatus

func (ProjectStatus) MarshalText added in v0.3.0

func (x ProjectStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (ProjectStatus) Ptr added in v0.3.0

func (x ProjectStatus) Ptr() *ProjectStatus

func (*ProjectStatus) Scan added in v0.1.5

func (x *ProjectStatus) Scan(value interface{}) (err error)

Scan implements the Scanner interface.

func (ProjectStatus) String added in v0.1.5

func (x ProjectStatus) String() string

String implements the Stringer interface.

func (*ProjectStatus) UnmarshalText added in v0.3.0

func (x *ProjectStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

func (ProjectStatus) Value added in v0.1.5

func (x ProjectStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type X

type X struct {
}

X is doc'ed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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