Documentation ¶
Overview ¶
Package spaces contains the kf sub-commands for manipulating spaces.
Index ¶
- func DiffWrapper(w io.Writer, mutator spaces.Mutator) spaces.Mutator
- func FormatDiff(w io.Writer, leftName, rightName string, left, right *v1alpha1.Space)
- func NewConfigSpaceCommand(p *config.KfParams, client spaces.Client) *cobra.Command
- func NewCreateSpaceCommand(p *config.KfParams, client spaces.Client) *cobra.Command
- func NewDeleteSpaceCommand(p *config.KfParams) *cobra.Command
- func NewDomainsCommand(p *config.KfParams, client spaces.Client) *cobra.Command
- func NewGetSpaceCommand(p *config.KfParams) *cobra.Command
- func NewListSpacesCommand(p *config.KfParams) *cobra.Command
- func NewSetSpaceRoleCommand(p *config.KfParams, kubeClient kubernetes.Interface) *cobra.Command
- func NewSpaceUsersCommand(p *config.KfParams, kubeClient kubernetes.Interface) *cobra.Command
- func NewUnsetSpaceRoleCommand(p *config.KfParams, kubeClient kubernetes.Interface) *cobra.Command
- type Subject
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffWrapper ¶
DiffWrapper wraps a mutator and prints out the diff between the original object and the one it returns if there's no error.
Example (Changes) ¶
obj := &v1alpha1.Space{} obj.Name = "opaque" contents := &bytes.Buffer{} wrapper := DiffWrapper(contents, func(obj *v1alpha1.Space) error { obj.Name = "docker-creds" return nil }) fmt.Println("Error:", wrapper(obj)) firstLine := strings.Split(contents.String(), "\n")[0] fmt.Println("First line:", firstLine)
Output: Error: <nil> First line: Space Diff (-old +new):
Example (Err) ¶
obj := &v1alpha1.Space{} wrapper := DiffWrapper(os.Stdout, func(_ *v1alpha1.Space) error { return errors.New("some-error") }) fmt.Println(wrapper(obj))
Output: some-error
Example (NoDiff) ¶
obj := &v1alpha1.Space{} wrapper := DiffWrapper(os.Stdout, func(s *v1alpha1.Space) error { // don't mutate the object return nil }) wrapper(obj)
Output: No changes
func FormatDiff ¶
FormatDiff creates a diff between two v1alpha1.Spaces and writes it to the given writer.
func NewConfigSpaceCommand ¶
NewConfigSpaceCommand creates a command that can set facets of a space.
func NewCreateSpaceCommand ¶
NewCreateSpaceCommand allows users to create spaces.
func NewDeleteSpaceCommand ¶
NewDeleteSpaceCommand allows users to delete spaces.
func NewDomainsCommand ¶
NewDomainsCommand allows developers to list domains for a Space.
func NewGetSpaceCommand ¶
NewGetSpaceCommand allows users to create spaces.
func NewListSpacesCommand ¶
NewListSpacesCommand allows users to list spaces.
func NewSetSpaceRoleCommand ¶
NewSetSpaceRoleCommand allows users to assign role to a subject.
func NewSpaceUsersCommand ¶
NewSpaceUsersCommand allows users to list users for a Space.
func NewUnsetSpaceRoleCommand ¶
NewUnsetSpaceRoleCommand allows users to un-assign role to a subject.