Documentation ¶
Index ¶
- func NewList(items []list.Item) list.Model
- type Accepting
- type AcceptingFunc
- type Back
- type Cmd
- func (c *Cmd) AfterApply(kongCtx *kong.Context) error
- func (c *Cmd) Run(ctx context.Context, kongCtx *kong.Context, upCtx *upbound.Context) error
- func (c *Cmd) RunInteractive(ctx context.Context, kongCtx *kong.Context, upCtx *upbound.Context, ...) error
- func (c *Cmd) RunNonInteractive(ctx context.Context, upCtx *upbound.Context, navCtx *navContext, ...) error
- func (c *Cmd) RunSwap(ctx context.Context, upCtx *upbound.Context, navCtx *navContext) error
- type ControlPlane
- func (ctp *ControlPlane) Accept(upCtx *upbound.Context, navCtx *navContext) (msg string, err error)
- func (ctp *ControlPlane) Back(m model) (model, error)
- func (ctp *ControlPlane) BackLabel() string
- func (ctp *ControlPlane) Breadcrumbs() string
- func (ctp *ControlPlane) Items(ctx context.Context, upCtx *upbound.Context, navCtx *navContext) ([]list.Item, error)
- func (ctp *ControlPlane) NamespacedName() types.NamespacedName
- type Disconnected
- type Group
- func (g *Group) Accept(upCtx *upbound.Context, navCtx *navContext) (msg string, err error)
- func (g *Group) Back(m model) (model, error)
- func (g *Group) BackLabel() string
- func (g *Group) Breadcrumbs() string
- func (g *Group) Items(ctx context.Context, upCtx *upbound.Context, navCtx *navContext) ([]list.Item, error)
- type KeyFunc
- type NavigationState
- func DeriveExistingCloudState(upCtx *upbound.Context, conf *clientcmdapi.Config, ...) (NavigationState, error)
- func DeriveExistingDisconnectedState(ctx context.Context, upCtx *upbound.Context, conf *clientcmdapi.Config, ...) (NavigationState, error)
- func DeriveNewState(ctx context.Context, conf *clientcmdapi.Config, ...) (NavigationState, error)
- func DeriveState(ctx context.Context, upCtx *upbound.Context, conf *clientcmdapi.Config, ...) (NavigationState, error)
- type Organization
- type Root
- type Space
- func (s *Space) Accept(upCtx *upbound.Context, navCtx *navContext) (msg string, err error)
- func (s *Space) Back(m model) (model, error)
- func (s *Space) BackLabel() string
- func (s *Space) Breadcrumbs() string
- func (s *Space) GetClient(upCtx *upbound.Context) (client.Client, error)
- func (s *Space) IsCloud() bool
- func (s *Space) Items(ctx context.Context, upCtx *upbound.Context, navCtx *navContext) ([]list.Item, error)
- type Termination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Accepting ¶
type Accepting interface { NavigationState Accept(upCtx *upbound.Context, navCtx *navContext) (string, error) }
Accepting is a model state that provides a method to accept a navigation node.
type AcceptingFunc ¶
type Back ¶
type Back interface { NavigationState Back(m model) (model, error) BackLabel() string }
Back is a model state that provides a method to go back to the parent navigation node.
type Cmd ¶
type Cmd struct { // Common Upbound API configuration Flags upbound.Flags `embed:""` Argument string `` /* 132-byte string literal not displayed */ Short bool `short:"s" env:"UP_SHORT" name:"short" help:"Short output."` KubeContext string `env:"UP_CONTEXT" default:"upbound" name:"context" help:"Kubernetes context to operate on."` File string `short:"f" name:"kubeconfig" help:"Kubeconfig to modify when saving a new context"` }
func (*Cmd) RunInteractive ¶
func (*Cmd) RunNonInteractive ¶ added in v0.32.0
type ControlPlane ¶
ControlPlane provides the navigation node for a concrete controlplane.
func (*ControlPlane) Accept ¶
func (ctp *ControlPlane) Accept(upCtx *upbound.Context, navCtx *navContext) (msg string, err error)
Accept upserts a controlplane context and cluster to the chosen kubeconfig.
func (*ControlPlane) Back ¶
func (ctp *ControlPlane) Back(m model) (model, error)
func (*ControlPlane) BackLabel ¶ added in v0.31.0
func (ctp *ControlPlane) BackLabel() string
func (*ControlPlane) Breadcrumbs ¶
func (ctp *ControlPlane) Breadcrumbs() string
func (*ControlPlane) NamespacedName ¶
func (ctp *ControlPlane) NamespacedName() types.NamespacedName
type Disconnected ¶ added in v0.31.0
type Disconnected struct{}
func (*Disconnected) Back ¶ added in v0.31.0
func (d *Disconnected) Back(m model) (model, error)
func (*Disconnected) BackLabel ¶ added in v0.31.0
func (d *Disconnected) BackLabel() string
func (*Disconnected) Breadcrumbs ¶ added in v0.31.0
func (d *Disconnected) Breadcrumbs() string
type Group ¶
Group provides the navigation node for a concrete group aka namespace.
func (*Group) Accept ¶
Accept upserts the "upbound" kubeconfig context and cluster to the chosen kubeconfig, pointing to the group.
func (*Group) Breadcrumbs ¶
type NavigationState ¶
type NavigationState interface {}
NavigationState is a model state that provides a list of items for a navigation node.
func DeriveExistingCloudState ¶ added in v0.30.0
func DeriveExistingCloudState(upCtx *upbound.Context, conf *clientcmdapi.Config, cloud *upbound.CloudConfiguration) (NavigationState, error)
DeriveExistingCloudState derives the navigation state assuming that the current context in the passed kubeconfig is pointing at an existing Cloud space previously created by the CLI
func DeriveExistingDisconnectedState ¶ added in v0.30.0
func DeriveExistingDisconnectedState(ctx context.Context, upCtx *upbound.Context, conf *clientcmdapi.Config, disconnected *upbound.DisconnectedConfiguration, getIngressHost getIngressHostFn) (NavigationState, error)
DeriveExistingDisconnectedState derives the navigation state assuming the current context in the passed kubeconfig is pointing at an existing disconnected space created by the CLI
func DeriveNewState ¶ added in v0.30.0
func DeriveNewState(ctx context.Context, conf *clientcmdapi.Config, getIngressHost getIngressHostFn) (NavigationState, error)
DeriveNewState derives the current navigation state assuming that the current context was created by a process other than the CLI. Depending on what we are pointing at, there are a few options as to what to do. If spaces **is not** installed in the cluster, then we fall back to root Cloud navigation. If spaces **is** installed cluster, we should derive the space information from the cluster. For all other cases and for all errors, we should fall back to root Cloud navigation. TODO(redbackthomson): Add support for passing a non-blocking error message back if derivation was partially successful (maybe only when --debug is set?)
func DeriveState ¶
func DeriveState(ctx context.Context, upCtx *upbound.Context, conf *clientcmdapi.Config, getIngressHost getIngressHostFn) (NavigationState, error)
DeriveState returns the navigation state based on the current context set in the given kubeconfig
type Organization ¶
type Organization struct {
Name string
}
func (*Organization) Back ¶
func (o *Organization) Back(m model) (model, error)
func (*Organization) BackLabel ¶ added in v0.31.0
func (o *Organization) BackLabel() string
func (*Organization) Breadcrumbs ¶
func (o *Organization) Breadcrumbs() string
type Space ¶
type Space struct { Org Organization Name string Ingress spaces.SpaceIngress AuthInfo *clientcmdapi.AuthInfo // HubContext is an optional field that stores which context in the // kubeconfig points at the hub HubContext string }
Space provides the navigation node for a space.
func (*Space) Accept ¶
Accept upserts the "upbound" kubeconfig context and cluster to the chosen kubeconfig, pointing to the space.
func (*Space) Breadcrumbs ¶
type Termination ¶
Termination is a model state that indicates the command should be terminated, optionally with a message and an error.