app

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 72 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIErrors

type APIErrors struct {
	Errors []string `json:"errors,omitempty"`
}

type App

type App struct {
	Cfn     context.CancelFunc
	RootCmd *cobra.Command

	Config *config.Config

	Outputs map[string]outputs.Output
	Inputs  map[string]inputs.Input
	Targets map[string]*target.Target

	//
	Logger *log.Logger

	// prompt mode
	PromptMode    bool
	PromptHistory []string
	SchemaTree    *yang.Entry
	// contains filtered or unexported fields
}

func New

func New() *App

func (*App) AddOutputConfig

func (a *App) AddOutputConfig(name string, cfg map[string]interface{}) error

AddOutputConfig adds an output called name, with config cfg if it does not already exist

func (*App) AddTargetConfig

func (a *App) AddTargetConfig(tc *types.TargetConfig)

AddTargetConfig adds a *TargetConfig to the configuration map

func (*App) CapPreRunE

func (a *App) CapPreRunE(cmd *cobra.Command, _ []string) error

func (*App) CapRunE

func (a *App) CapRunE(cmd *cobra.Command, args []string) error

func (*App) CleanupPlugins added in v0.35.0

func (a *App) CleanupPlugins()

func (*App) ClientCapabilities

func (a *App) ClientCapabilities(ctx context.Context, tc *types.TargetConfig, ext ...*gnmi_ext.Extension) (*gnmi.CapabilityResponse, error)

func (*App) ClientGet

func (a *App) ClientGet(ctx context.Context, tc *types.TargetConfig, req *gnmi.GetRequest) (*gnmi.GetResponse, error)

func (*App) ClientSet

func (a *App) ClientSet(ctx context.Context, tc *types.TargetConfig, req *gnmi.SetRequest) (*gnmi.SetResponse, error)

func (*App) Context

func (a *App) Context() context.Context

func (*App) CreateGNMIClient

func (a *App) CreateGNMIClient(ctx context.Context, t *target.Target) error

func (*App) CreateTarget

func (a *App) CreateTarget(name string) error

func (*App) DeleteOutput

func (a *App) DeleteOutput(name string) error

func (*App) DeleteTarget

func (a *App) DeleteTarget(ctx context.Context, name string) error

func (*App) DiffPreRunE

func (a *App) DiffPreRunE(cmd *cobra.Command, args []string) error

func (*App) DiffRunE

func (a *App) DiffRunE(cmd *cobra.Command, args []string) error

func (*App) DiffSetRequestRunE

func (a *App) DiffSetRequestRunE(cmd *cobra.Command, args []string) error

func (*App) DiffSetToNotifsRunE

func (a *App) DiffSetToNotifsRunE(cmd *cobra.Command, args []string) error

func (*App) Export

func (a *App) Export(ctx context.Context, rsp *gnmi.SubscribeResponse, m outputs.Meta, outs ...string)

func (*App) GeneratePathPreRunE

func (a *App) GeneratePathPreRunE(cmd *cobra.Command, args []string) error

func (*App) GeneratePathRunE

func (a *App) GeneratePathRunE(cmd *cobra.Command, args []string) error

func (*App) GeneratePreRunE

func (a *App) GeneratePreRunE(cmd *cobra.Command, args []string) error

func (*App) GenerateRunE

func (a *App) GenerateRunE(cmd *cobra.Command, args []string) error

func (*App) GenerateSetRequestRunE

func (a *App) GenerateSetRequestRunE(cmd *cobra.Command, args []string) error

func (*App) GetModels

func (a *App) GetModels(ctx context.Context, tc *types.TargetConfig) ([]*gnmi.ModelData, error)

func (*App) GetPreRunE

func (a *App) GetPreRunE(cmd *cobra.Command, args []string) error

func (*App) GetRequest

func (a *App) GetRequest(ctx context.Context, tc *types.TargetConfig)

func (*App) GetRun

func (a *App) GetRun(cmd *cobra.Command, args []string) error

func (*App) GetSetPreRunE

func (a *App) GetSetPreRunE(cmd *cobra.Command, args []string) error

func (*App) GetSetRequest

func (a *App) GetSetRequest(ctx context.Context, tc *types.TargetConfig, req *gnmi.GetRequest)

func (*App) GetSetRunE

func (a *App) GetSetRunE(cmd *cobra.Command, args []string) error

func (*App) GetTargets

func (a *App) GetTargets() (map[string]*types.TargetConfig, error)

GetTargets reads the targets configuration from flags or config file. If enabled it will load targets from a configured tunnel server.

func (*App) InitCapabilitiesFlags

func (a *App) InitCapabilitiesFlags(cmd *cobra.Command)

func (*App) InitDiffFlags

func (a *App) InitDiffFlags(cmd *cobra.Command)

InitDiffFlags used to init or reset diffCmd flags for gnmic-prompt mode

func (*App) InitDiffSetRequestFlags

func (a *App) InitDiffSetRequestFlags(cmd *cobra.Command)

InitDiffSetRequestFlags used to init or reset diffSetRequestCmd flags for gnmic-prompt mode

func (*App) InitDiffSetToNotifsFlags

func (a *App) InitDiffSetToNotifsFlags(cmd *cobra.Command)

InitDiffSetToNotifsFlags used to init or reset newDiffSetRequestCmd flags for gnmic-prompt mode

func (*App) InitGenerateFlags

func (a *App) InitGenerateFlags(cmd *cobra.Command)

func (*App) InitGeneratePathFlags

func (a *App) InitGeneratePathFlags(cmd *cobra.Command)

func (*App) InitGenerateSetRequestFlags

func (a *App) InitGenerateSetRequestFlags(cmd *cobra.Command)

func (*App) InitGetFlags

func (a *App) InitGetFlags(cmd *cobra.Command)

InitGetFlags used to init or reset getCmd flags for gnmic-prompt mode

func (*App) InitGetSetFlags

func (a *App) InitGetSetFlags(cmd *cobra.Command)

InitGetSetFlags used to init or reset getsetCmd flags for gnmic-prompt mode

func (*App) InitGlobalFlags

func (a *App) InitGlobalFlags()

func (*App) InitInput

func (a *App) InitInput(ctx context.Context, name string, tcs map[string]*types.TargetConfig)

func (*App) InitInputs

func (a *App) InitInputs(ctx context.Context)

func (*App) InitLocker

func (a *App) InitLocker() error

func (*App) InitOutput

func (a *App) InitOutput(ctx context.Context, name string, tcs map[string]*types.TargetConfig)

func (*App) InitOutputs

func (a *App) InitOutputs(ctx context.Context)

func (*App) InitPathFlags

func (a *App) InitPathFlags(cmd *cobra.Command)

func (*App) InitProcessorFlags added in v0.37.0

func (a *App) InitProcessorFlags(cmd *cobra.Command)

func (*App) InitPromptFlags

func (a *App) InitPromptFlags(cmd *cobra.Command)

func (*App) InitSetFlags

func (a *App) InitSetFlags(cmd *cobra.Command)

InitSetFlags used to init or reset setCmd flags for gnmic-prompt mode

func (*App) InitSubscribeFlags

func (a *App) InitSubscribeFlags(cmd *cobra.Command)

InitSubscribeFlags used to init or reset subscribeCmd flags for gnmic-prompt mode

func (*App) LoadProtoFiles

func (a *App) LoadProtoFiles() (desc.Descriptor, error)

func (*App) PathCmdRun

func (a *App) PathCmdRun(d, f, e []string, pgo pathGenOpts) error

func (*App) PathPreRunE

func (a *App) PathPreRunE(cmd *cobra.Command, args []string) error

func (*App) PathRunE

func (a *App) PathRunE(cmd *cobra.Command, args []string) error

func (*App) PreRunE

func (a *App) PreRunE(cmd *cobra.Command, args []string) error

func (*App) PrintMsg

func (a *App) PrintMsg(address string, msgName string, msg proto.Message) error

func (*App) ProcessorPreRunE added in v0.37.0

func (a *App) ProcessorPreRunE(cmd *cobra.Command, args []string) error

func (*App) ProcessorRunE added in v0.37.0

func (a *App) ProcessorRunE(cmd *cobra.Command, args []string) error

func (*App) PromptPreRunE

func (a *App) PromptPreRunE(cmd *cobra.Command, args []string) error

PreRun resolve the glob patterns and checks if --max-suggestions is bigger that the terminal height and lowers it if needed.

func (*App) PromptRunE

func (a *App) PromptRunE(cmd *cobra.Command, args []string) error

func (*App) ProxyPreRunE added in v0.37.0

func (a *App) ProxyPreRunE(cmd *cobra.Command, args []string) error

func (*App) ProxyRunE added in v0.37.0

func (a *App) ProxyRunE(cmd *cobra.Command, args []string) error

func (*App) ReqCapabilities

func (a *App) ReqCapabilities(ctx context.Context, tc *types.TargetConfig)

func (*App) SetPreRunE

func (a *App) SetPreRunE(cmd *cobra.Command, args []string) error

func (*App) SetRequest

func (a *App) SetRequest(ctx context.Context, tc *types.TargetConfig)

func (*App) SetRunE

func (a *App) SetRunE(cmd *cobra.Command, args []string) error

func (*App) StartCollector

func (a *App) StartCollector(ctx context.Context)

func (*App) SubscribePreRunE

func (a *App) SubscribePreRunE(cmd *cobra.Command, args []string) error

func (*App) SubscribeRunE

func (a *App) SubscribeRunE(cmd *cobra.Command, args []string) error

func (*App) SubscribeRunONCE

func (a *App) SubscribeRunONCE(_ *cobra.Command, _ []string) error

func (*App) SubscribeRunPoll

func (a *App) SubscribeRunPoll(cmd *cobra.Command, args []string) error

func (*App) SubscribeRunPrompt

func (a *App) SubscribeRunPrompt(cmd *cobra.Command, args []string) error

func (*App) TargetSubscribeOnce

func (a *App) TargetSubscribeOnce(ctx context.Context, tc *types.TargetConfig) error

func (*App) TargetSubscribePoll

func (a *App) TargetSubscribePoll(ctx context.Context, tc *types.TargetConfig)

func (*App) TargetSubscribeStream

func (a *App) TargetSubscribeStream(ctx context.Context, tc *types.TargetConfig)

func (*App) UpdateTargetSubscription added in v0.38.0

func (a *App) UpdateTargetSubscription(ctx context.Context, name string, subs []string) error

UpdateTargetConfig updates the subscriptions for an existing target

func (*App) VersionRun

func (a *App) VersionRun(cmd *cobra.Command, args []string)

func (*App) VersionUpgradeRun

func (a *App) VersionUpgradeRun(cmd *cobra.Command, args []string) error

Jump to

Keyboard shortcuts

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