common

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity added in v0.5.0

type Entity struct {
	Type  string `json:"type"  mapstructure:"type"`
	ID    int    `json:"id"    mapstructure:"id"`
	Name  string `json:"name"  mapstructure:"name"`
	Links Links  `json:"links" mapstructure:"links"`
}

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 Link struct {
	Name   string  `json:"name,omitempty" mapstructure:"name"`
	HREF   url.URL `json:"-"`
	GitRef string  `json:"-"`
}

func (Link) MarshalJSON added in v0.5.0

func (link Link) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface.

func (*Link) UnmarshalJSON added in v0.5.0

func (link *Link) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface.

type Links struct {
	Self           *Link  `json:"self,omitempty"            mapstructure:"self"`
	HTML           *Link  `json:"html,omitempty"            mapstructure:"html"`
	Avatar         *Link  `json:"avatar,omitempty"          mapstructure:"avatar"`
	Branches       *Link  `json:"branches,omitempty"        mapstructure:"branches"`
	Forks          *Link  `json:"forks,omitempty"           mapstructure:"forks"`
	Commits        *Link  `json:"commits,omitempty"         mapstructure:"commits"`
	PullRequests   *Link  `json:"pullrequests,omitempty"    mapstructure:"pullrequests"`
	Approve        *Link  `json:"approve,omitempty"         mapstructure:"approve"`
	RequestChanges *Link  `json:"request-changes,omitempty" mapstructure:"request-changes"`
	Diff           *Link  `json:"diff,omitempty"            mapstructure:"diff"`
	DiffStat       *Link  `json:"diffstat,omitempty"        mapstructure:"diffstat"`
	Patch          *Link  `json:"patch,omitempty"           mapstructure:"patch"`
	Comments       *Link  `json:"comments,omitempty"        mapstructure:"comments"`
	Activity       *Link  `json:"activity,omitempty"        mapstructure:"activity"`
	Merge          *Link  `json:"merge,omitempty"           mapstructure:"merge"`
	Decline        *Link  `json:"decline,omitempty"         mapstructure:"decline"`
	Statuses       *Link  `json:"statuses,omitempty"        mapstructure:"statuses"`
	Tags           *Link  `json:"tags,omitempty"            mapstructure:"tags"`
	Watchers       *Link  `json:"watchers,omitempty"        mapstructure:"watchers"`
	Downloads      *Link  `json:"downloads,omitempty"       mapstructure:"downloads"`
	Source         *Link  `json:"source,omitempty"          mapstructure:"source"`
	Clone          []Link `json:"clone,omitempty"           mapstructure:"clone"`
	Hooks          *Link  `json:"hooks,omitempty"           mapstructure:"hooks"`
}

type RemoteValueFlag added in v0.2.0

type RemoteValueFlag struct {
	AllowedFunc func(context.Context, *cobra.Command, []string) []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"` // markdown, creaole, plaintext
	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, headers []string) []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

type UUID added in v0.4.0

type UUID uuid.UUID

func NewUUID added in v0.4.0

func NewUUID() UUID

func ParseUUID added in v0.4.0

func ParseUUID(s string) (UUID, error)

func (UUID) IsNil added in v0.4.0

func (u UUID) IsNil() bool

func (UUID) MarshalJSON added in v0.4.0

func (u UUID) MarshalJSON() ([]byte, error)

func (UUID) String added in v0.4.0

func (u UUID) String() string

func (*UUID) UnmarshalJSON added in v0.4.0

func (u *UUID) UnmarshalJSON(payload []byte) error

Jump to

Keyboard shortcuts

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