cmd

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAction

func CreateAction(ctx *pkg.AppContext, operator string) ([]payload, error)

func Execute

func Execute(ctx *pkg.AppContext) *cobra.Command

func GenerateConfig

func GenerateConfig(ctx *pkg.AppContext, opts *GenerateConfigOptions) error

func NamespaceCreateCmd

func NamespaceCreateCmd(ctx *pkg.AppContext) *cobra.Command

func NamespaceCurrentCmd

func NamespaceCurrentCmd(ctx *pkg.AppContext) *cobra.Command

func NamespaceDestroyCmd

func NamespaceDestroyCmd(ctx *pkg.AppContext) *cobra.Command

func NamespaceListCmd

func NamespaceListCmd(ctx *pkg.AppContext) *cobra.Command

func NewApplyCmd

func NewApplyCmd(ctx *pkg.AppContext) *cobra.Command

func NewConfigCmd

func NewConfigCmd(ctx *pkg.AppContext) *cobra.Command

func NewConfigGetCmd

func NewConfigGetCmd(_ *pkg.AppContext) *cobra.Command

func NewConfigSetCmd

func NewConfigSetCmd(_ *pkg.AppContext) *cobra.Command

func NewGenerateConfigCmd

func NewGenerateConfigCmd(ctx *pkg.AppContext) *cobra.Command

func NewGetCmd

func NewGetCmd(ctx *pkg.AppContext, buf *bytes.Buffer) *cobra.Command

func NewInit

func NewInit(ctx *pkg.AppContext) *cobra.Command

func NewLoginCmd

func NewLoginCmd(ctx *pkg.AppContext) *cobra.Command

TODO: Instead of printing from the auth service's methods, use a goroutine and post back status updates to this function to keep in line with other methods

func NewNamespaceCmd

func NewNamespaceCmd(ctx *pkg.AppContext) *cobra.Command

func NewPublishCmd

func NewPublishCmd(ctx *pkg.AppContext) *cobra.Command

func NewPublishGatewayCmd

func NewPublishGatewayCmd(ctx *pkg.AppContext) *cobra.Command

func NewRootCommand

func NewRootCommand(ctx *pkg.AppContext) *cobra.Command

func NewStatusCmd

func NewStatusCmd(ctx *pkg.AppContext, buf *bytes.Buffer) *cobra.Command

func Publish added in v1.6.0

func Publish(ctx *pkg.AppContext, body []byte, arg string) error

func PublishGatewayService

func PublishGatewayService(ctx *pkg.AppContext, doc parsedConfig) error

func PublishResource

func PublishResource(ctx *pkg.AppContext, doc parsedConfig, arg string) (string, error)

Types

type ApplyOptions

type ApplyOptions struct {
	// contains filtered or unexported fields
}

func (*ApplyOptions) Parse

func (o *ApplyOptions) Parse(cwd string) ([][]byte, error)

Takes a dir to locate the input file and returns a slice of each doc contained in the YAML file

type GenerateConfigOptions

type GenerateConfigOptions struct {
	Namespace        string
	Template         string
	Service          string
	Upstream         string
	UpstreamUrl      *url.URL
	UpstreamPort     string
	Organization     string
	OrganizationUnit string
	Out              string
}

func (*GenerateConfigOptions) Exec

func (o *GenerateConfigOptions) Exec() error

func (*GenerateConfigOptions) ParseUpstream

func (o *GenerateConfigOptions) ParseUpstream() error

func (*GenerateConfigOptions) ValidateTemplate

func (o *GenerateConfigOptions) ValidateTemplate() error

type LoginFlags

type LoginFlags struct {
	// contains filtered or unexported fields
}

func (*LoginFlags) IsClientCredential

func (l *LoginFlags) IsClientCredential() bool

type NamespaceDestroyOptions

type NamespaceDestroyOptions struct {
	Force bool `url:"force"`
}

type NamespaceFormData

type NamespaceFormData struct {
	Name        string `json:"name,omitempty" url:"name,omitempty"`
	Description string `json:"displayName,omitempty" url:"description,omitempty"`
}

type NamespaceResult

type NamespaceResult struct {
	Name        string `json:"name,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
}

type OutputFlags

type OutputFlags struct {
	Json bool
	Yaml bool
}

type PublishCounter

type PublishCounter struct {
	Success int
	Failed  int
	Skipped int
}

func (*PublishCounter) AddFailed

func (p *PublishCounter) AddFailed()

func (*PublishCounter) AddSkipped

func (p *PublishCounter) AddSkipped()

func (*PublishCounter) AddSuccess

func (p *PublishCounter) AddSuccess()

func (*PublishCounter) Print

func (p *PublishCounter) Print() string

type PublishGatewayOptions

type PublishGatewayOptions struct {
	// contains filtered or unexported fields
}

type PublishGatewayResponse

type PublishGatewayResponse struct {
	Message string `json:"message"`
	Results string `json:"results"`
	Error   string `json:"error"`
}

func PublishToGateway

func PublishToGateway(ctx *pkg.AppContext, opts *PublishGatewayOptions, configFile io.Reader) (PublishGatewayResponse, error)

type PublishOptions added in v1.6.0

type PublishOptions struct {
	// contains filtered or unexported fields
}

func (*PublishOptions) ParseInput added in v1.6.0

func (o *PublishOptions) ParseInput(ctx *pkg.AppContext) ([]byte, error)

type PublishResponse added in v1.6.0

type PublishResponse struct {
	Status       int
	Result       string
	Reason       string
	Id           string
	OwnedBy      string
	ChildResults string
}

type PutResponse

type PutResponse struct {
	Status       int
	Result       string
	Reason       string
	Id           string
	OwnedBy      string
	ChildResults string
}

type ResourceConfig

type ResourceConfig struct {
	Config map[string]interface{}
	Kind   string
}

func ExtractResourceConfig

func ExtractResourceConfig(doc []byte) (*ResourceConfig, error)

doc is a single yaml document

func (*ResourceConfig) Action

func (r *ResourceConfig) Action() string

type StatusJson

type StatusJson struct {
	Name     string `json:"name"`
	Upstream string `json:"upstream"`
	Status   string `json:"status"`
	Reason   string `json:"reason"`
	Host     string `json:"host"`
	EnvHost  string `json:"env_host"`
}

func FetchStatus

func FetchStatus(ctx *pkg.AppContext) ([]StatusJson, error)

Jump to

Keyboard shortcuts

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