common

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppUser

type AppUser struct {
	Type          string     `json:"type"           mapstructure:"type"`
	ID            string     `json:"uuid"           mapstructure:"uuid"`
	Name          string     `json:"display_name"   mapstructure:"display_name"`
	AccountID     string     `json:"account_id"     mapstructure:"account_id"`
	AccountStatus string     `json:"account_status" mapstructure:"account_status"`
	Kind          string     `json:"kind"           mapstructure:"kind"`
	Links         link.Links `json:"links"          mapstructure:"links"`
	CreatedOn     time.Time  `json:"created_on"     mapstructure:"created_on"`
}

func (AppUser) MarshalJSON

func (user AppUser) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface.

type EnumFlag

type EnumFlag struct {
	Allowed []string
	Value   string
}

func (EnumFlag) CompletionFunc added in v0.2.0

func (flag EnumFlag) CompletionFunc() func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

CompletionFunc returns the completion function of the flag

func (*EnumFlag) Set

func (flag *EnumFlag) Set(value string) error

Set sets the flag value

func (EnumFlag) String

func (flag EnumFlag) String() string

String returns the string representation of the flag

func (EnumFlag) Type

func (flag EnumFlag) Type() string

Type returns the type of the flag

type RemoteValueFlag added in v0.2.0

type RemoteValueFlag struct {
	AllowedFunc func(context.Context) []string
	Value       string
}

func (*RemoteValueFlag) CompletionFunc added in v0.2.0

func (flag *RemoteValueFlag) CompletionFunc() func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

CompletionFunc returns the completion function of the flag

func (*RemoteValueFlag) Set added in v0.2.0

func (flag *RemoteValueFlag) Set(value string) error

Set sets the flag value

func (RemoteValueFlag) String added in v0.2.0

func (flag RemoteValueFlag) String() string

String returns the string representation of the flag

func (RemoteValueFlag) Type added in v0.2.0

func (flag RemoteValueFlag) Type() string

Type returns the type of the flag

type RenderedText

type RenderedText struct {
	Type   string `json:"type" mapstructure:"type"`
	Raw    string `json:"raw"  mapstructure:"raw"`
	Markup string `json:"markup"  mapstructure:"markup"`
	HTML   string `json:"html"  mapstructure:"html"`
}

type Tableable added in v0.3.0

type Tableable interface {
	GetHeader(short bool) []string    // GetHeader retrieves the headers to show, if short is true get the short version
	GetRow(headers []string) []string // GetRow retrieves the row to show for the given headers
}

Tableable is an interface for objects that can be printed as a table

type Tableables added in v0.3.0

type Tableables interface {
	GetHeader() []string         // GetHeader retrieves the headers to show
	GetRowAt(index int) []string // GetRow retrieves the row to show for the given headers
	Size() int                   // Size gets the number of elements
}

Tableables is an interface for array of objects that can be printed as a table

Jump to

Keyboard shortcuts

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