profile

package
v1.19.3 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package profile provides commands for managing BindPlane profile configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(builder Builder) *cobra.Command

Command returns the BindPlane profile cobra command.

func CreateCommand

func CreateCommand(builder Builder) *cobra.Command

CreateCommand returns the BindPlane profile create cobra command

func CurrentCommand

func CurrentCommand(builder Builder) *cobra.Command

CurrentCommand returns the BindPlane profile current cobra command

func DeleteCommand

func DeleteCommand(builder Builder) *cobra.Command

DeleteCommand returns the BindPlane profile delete cobra command

func GetCommand

func GetCommand(builder Builder) *cobra.Command

GetCommand returns the BindPlane profile get cobra command

func ListCommand

func ListCommand(builder Builder) *cobra.Command

ListCommand returns the BindPlane profile list cobra command

func SetCommand

func SetCommand(builder Builder) *cobra.Command

SetCommand returns the BindPlane profile set cobra command

func UseCommand

func UseCommand(builder Builder) *cobra.Command

UseCommand returns the BindPlane profile use cobra command

Types

type Builder

type Builder interface {
	// Build returns a new Profiler.
	BuildProfiler(ctx context.Context) (Profiler, error)
}

Builder is an interface for building a Profiler.

type DefaultProfiler

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

DefaultProfiler is the default implementation of Profiler.

func NewProfiler

func NewProfiler(folder string) *DefaultProfiler

NewProfiler returns a new Profiler.

func (*DefaultProfiler) CreateProfile

func (p *DefaultProfiler) CreateProfile(ctx context.Context, name string) error

CreateProfile creates a new profile.

func (*DefaultProfiler) DeleteProfile

func (p *DefaultProfiler) DeleteProfile(_ context.Context, name string) error

DeleteProfile deletes a profile.

func (*DefaultProfiler) EnsureProfilesFolder

func (p *DefaultProfiler) EnsureProfilesFolder() error

EnsureProfilesFolder ensures the profiles folder exists.

func (*DefaultProfiler) GetCurrentProfileName

func (p *DefaultProfiler) GetCurrentProfileName(_ context.Context) (string, error)

GetCurrentProfileName returns the name of the current profile.

func (*DefaultProfiler) GetProfileNames

func (p *DefaultProfiler) GetProfileNames(_ context.Context) ([]string, error)

GetProfileNames returns a list of profile names.

func (*DefaultProfiler) GetProfileRaw

func (p *DefaultProfiler) GetProfileRaw(_ context.Context, name string) (string, error)

GetProfileRaw returns the raw representation of a profile.

func (*DefaultProfiler) ProfileExists

func (p *DefaultProfiler) ProfileExists(_ context.Context, name string) bool

ProfileExists returns true if the profile with the given name exists.

func (*DefaultProfiler) ReadProfileBytes

func (p *DefaultProfiler) ReadProfileBytes(name string) ([]byte, error)

ReadProfileBytes reads the raw bytes of a profile.

func (*DefaultProfiler) SetCurrentProfileName

func (p *DefaultProfiler) SetCurrentProfileName(ctx context.Context, name string) error

SetCurrentProfileName sets the name of the currently used profile.

func (*DefaultProfiler) UpdateProfile

func (p *DefaultProfiler) UpdateProfile(_ context.Context, name string, values map[string]string) error

UpdateProfile updates a profile using the supplied flags.

func (*DefaultProfiler) WriteProfileBytes

func (p *DefaultProfiler) WriteProfileBytes(name string, bytes []byte) error

WriteProfileBytes writes the profile with raw bytes.

type Profiler

type Profiler interface {
	// GetProfileRaw returns the raw representation of a profile.
	GetProfileRaw(ctx context.Context, name string) (string, error)

	// GetCurrentProfileName returns the name of the currently used profile.
	GetCurrentProfileName(ctx context.Context) (string, error)

	// SetCurrentProfileName sets the name of the currently used profile.
	SetCurrentProfileName(ctx context.Context, name string) error

	// GetProfileNames returns a list of profile names.
	GetProfileNames(ctx context.Context) ([]string, error)

	// ProfileExists returns true if the profile exists.
	ProfileExists(ctx context.Context, name string) bool

	// CreateProfile creates a new profile.
	CreateProfile(ctx context.Context, name string) error

	// DeleteProfile deletes a profile.
	DeleteProfile(ctx context.Context, name string) error

	// UpdateProfile updates a profile.
	UpdateProfile(ctx context.Context, name string, values map[string]string) error
}

Profiler is an interface for managing BindPlane profiles

Jump to

Keyboard shortcuts

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