Documentation ¶
Overview ¶
Package profile provides commands for managing BindPlane profile configurations.
Index ¶
- func Command(builder Builder) *cobra.Command
- func CreateCommand(builder Builder) *cobra.Command
- func CurrentCommand(builder Builder) *cobra.Command
- func DeleteCommand(builder Builder) *cobra.Command
- func GetCommand(builder Builder) *cobra.Command
- func ListCommand(builder Builder) *cobra.Command
- func SetCommand(builder Builder) *cobra.Command
- func UseCommand(builder Builder) *cobra.Command
- type Builder
- type DefaultProfiler
- func (p *DefaultProfiler) CreateProfile(ctx context.Context, name string) error
- func (p *DefaultProfiler) DeleteProfile(_ context.Context, name string) error
- func (p *DefaultProfiler) EnsureProfilesFolder() error
- func (p *DefaultProfiler) GetCurrentProfileName(_ context.Context) (string, error)
- func (p *DefaultProfiler) GetProfileNames(_ context.Context) ([]string, error)
- func (p *DefaultProfiler) GetProfileRaw(_ context.Context, name string) (string, error)
- func (p *DefaultProfiler) ProfileExists(_ context.Context, name string) bool
- func (p *DefaultProfiler) ReadProfileBytes(name string) ([]byte, error)
- func (p *DefaultProfiler) SetCurrentProfileName(ctx context.Context, name string) error
- func (p *DefaultProfiler) UpdateProfile(_ context.Context, name string, values map[string]string) error
- func (p *DefaultProfiler) WriteProfileBytes(name string, bytes []byte) error
- type Profiler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCommand ¶
CreateCommand returns the BindPlane profile create cobra command
func CurrentCommand ¶
CurrentCommand returns the BindPlane profile current cobra command
func DeleteCommand ¶
DeleteCommand returns the BindPlane profile delete cobra command
func GetCommand ¶
GetCommand returns the BindPlane profile get cobra command
func ListCommand ¶
ListCommand returns the BindPlane profile list cobra command
func SetCommand ¶
SetCommand returns the BindPlane profile set cobra command
func UseCommand ¶
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 ¶
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