organization

package
v0.7.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIURL  = "http://a8ff89cbeec444c82b90c5f83a117b39-16361bbd933bde33.elb.cn-northwest-1.amazonaws.com.cn:8086"
	APIPath = "api/v1"
)
View Source
const (
	CloudContextDir          = "cloud_context"
	CurrentOrgAndContextFile = "current.json"
	ContextFile              = "context.json"
)

Variables

This section is empty.

Functions

func GetContextFilePath

func GetContextFilePath() (string, error)

func GetCurrentOrgAndContextFilePath

func GetCurrentOrgAndContextFilePath() (string, error)

func GetToken

func GetToken() (string, error)

func NewOrganizationCmd

func NewOrganizationCmd(streams genericiooptions.IOStreams) *cobra.Command

func NewRequest

func NewRequest(method, path, token string, requestBody []byte) ([]byte, error)

func SetCurrentOrgAndContext

func SetCurrentOrgAndContext(currentOrgAndContext *CurrentOrgAndContext) error

SetCurrentOrgAndContext TODO:Check whether the newly set context and org exist.

Types

type CloudOrganization

type CloudOrganization struct {
	Token   string
	APIURL  string
	APIPath string
}

func (*CloudOrganization) GetOrganizations

func (o *CloudOrganization) GetOrganizations() (*Organizations, error)

func (*CloudOrganization) IsValidOrganization

func (o *CloudOrganization) IsValidOrganization(name string) (bool, error)

type CurrentOrgAndContext

type CurrentOrgAndContext struct {
	CurrentOrganization string `json:"currentOrganization"`
	CurrentContext      string `json:"currentContext"`
}

func GetCurrentOrgAndContext

func GetCurrentOrgAndContext() (*CurrentOrgAndContext, error)

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Reason  string `json:"reason"`
}

type OrgItem

type OrgItem struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Role        string `json:"role"`
	Description string `json:"description"`
	DisplayName string `json:"displayName"`
	CreatedAt   string `json:"createdAt"`
	UpdatedAt   string `json:"updatedAt"`
}

type Organization

type Organization interface {
	GetOrganizations() (*Organizations, error)

	IsValidOrganization(name string) (bool, error)
	// contains filtered or unexported methods
}

type OrganizationOption

type OrganizationOption struct {
	Name         string
	OutputFormat string
	Organization Organization

	genericiooptions.IOStreams
}

type Organizations

type Organizations struct {
	Items []OrgItem `json:"items"`
}

Jump to

Keyboard shortcuts

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