user

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:     "account",
	Aliases: []string{"user"},
	Short:   "Manage accounts",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("Issue requires a subcommand:")
		for _, command := range cmd.Commands() {
			fmt.Println(command.Name())
		}
	},
}

Command represents this folder's command

Functions

This section is empty.

Types

type Account added in v0.5.0

type Account struct {
	Type          string       `json:"type"                     mapstructure:"type"`
	ID            common.UUID  `json:"uuid"                     mapstructure:"uuid"`
	Username      string       `json:"username,omitempty"       mapstructure:"username"`
	Name          string       `json:"display_name"             mapstructure:"display_name"`
	AccountID     string       `json:"account_id"               mapstructure:"account_id"`
	AccountStatus string       `json:"account_status,omitempty" mapstructure:"account_status"`
	Kind          string       `json:"kind,omitempty"           mapstructure:"kind"`
	Links         common.Links `json:"links"                    mapstructure:"links"`
	CreatedOn     time.Time    `json:"created_on"               mapstructure:"created_on"`
}

func GetAccount added in v0.5.0

func GetAccount(context context.Context, cmd *cobra.Command, currentProfile *profile.Profile, userid string) (account *Account, err error)

GetAccount gets a user

func GetMe added in v0.5.0

func GetMe(context context.Context, cmd *cobra.Command, currentProfile *profile.Profile) (account *Account, err error)

GetMe gets the current user

func (Account) GetHeader added in v0.5.0

func (account Account) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (Account) GetRow added in v0.5.0

func (account Account) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

func (Account) MarshalJSON added in v0.5.0

func (account Account) MarshalJSON() (data []byte, err error)

MarshalJSON implements the json.Marshaler interface.

type Author

type Author struct {
	Type string `json:"type"          mapstructure:"type"`
	Raw  string `json:"raw,omitempty" mapstructure:"raw"`
	User User   `json:"user"          mapstructure:"user"`
}

type Participant

type Participant struct {
	Type           string    `json:"type"            mapstructure:"type"`
	User           User      `json:"user"            mapstructure:"user"`
	Role           string    `json:"role"            mapstructure:"role"`
	Approved       bool      `json:"approved"        mapstructure:"approved"`
	State          string    `json:"state"           mapstructure:"state"`
	ParticipatedOn time.Time `json:"participated_on" mapstructure:"participated_on"`
}

func (Participant) GetHeader added in v0.3.0

func (participant Participant) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (Participant) GetRow added in v0.3.0

func (participant Participant) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

type User

type User struct {
	Type      string       `json:"type"          mapstructure:"type"`
	ID        common.UUID  `json:"uuid"          mapstructure:"uuid"`
	AccountID string       `json:"account_id"    mapstructure:"account_id"`
	Name      string       `json:"display_name"  mapstructure:"display_name"`
	Nickname  string       `json:"nickname"      mapstructure:"nickname"`
	Raw       string       `json:"raw,omitempty" mapstructure:"raw"`
	Links     common.Links `json:"links"         mapstructure:"links"`
}

func (User) GetHeader added in v0.4.0

func (user User) GetHeader(short bool) []string

GetHeader gets the header for a table

implements common.Tableable

func (User) GetRow added in v0.4.0

func (user User) GetRow(headers []string) []string

GetRow gets the row for a table

implements common.Tableable

Jump to

Keyboard shortcuts

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