Documentation ¶
Overview ¶
Package client provides helper functions for OpenConfig CLI tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFlags ¶
func ParseFlags() (username string, password string, subscriptions, addrs []string, opts []grpc.DialOption)
ParseFlags registers some additional common flags, parses the flags, and returns the resulting gRPC options, and other settings to connect to the gRPC interface.
func Run ¶
func Run(publish func(*openconfig.SubscribeResponse), wg *sync.WaitGroup, username, password, addr string, subscriptions []string, opts []grpc.DialOption)
Run creates a new gRPC client, sends subscriptions, and consumes responses. The given publish function is used to publish SubscribeResponses received for the given subscriptions, when connected to the given host, with the given user/pass pair, or the client-side cert specified in the gRPC opts. This function does not normally return so it should probably be run in its own goroutine. When this function returns, the given WaitGroup is marked as done.
Types ¶
This section is empty.