uuidflag

package
v0.0.0-...-d06bb7f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package uuidflag wraps a UUID so it satisfies the Value and Getter interface of the Go flag package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Uuid

type Uuid struct {
	uuid.UUID
	// contains filtered or unexported fields
}

Uuid wraps UUID.

func DefaultFromString

func DefaultFromString(val string) Uuid

DefaultFromString allows shortcut declaration of a UUID flag with a default value. It panics on error; if you don't want that, call the normal Set instance method. Note the flag is considered set after this.

func (*Uuid) Get

func (u *Uuid) Get() uuid.UUID

Get returns the UUID inside the wrapping type.

func (*Uuid) IsSet

func (u *Uuid) IsSet() bool

IsSet indicates whether the UUID value was set, i.e. non-zero byte array.

func (*Uuid) Set

func (u *Uuid) Set(val string) (err error)

Set function sets the UUID to the given string value or returns an error.

func (*Uuid) String

func (u *Uuid) String() string

String returns this type's default value for flag help. (If no default is set, the value is a zero-filled byte, so return empty string.)

Jump to

Keyboard shortcuts

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