Documentation ¶
Index ¶
- Constants
- func GetStaticClustersByName(configDump *adminv3.ConfigDump) (map[string]*clusterv3.Cluster, error)
- type Client
- func (c *Client) ClustersCmd(ctx context.Context) cmdutils.Cmd
- func (c *Client) Command(ctx context.Context, options ...curl.Option) cmdutils.Cmd
- func (c *Client) ConfigDumpCmd(ctx context.Context, queryParams map[string]string) cmdutils.Cmd
- func (c *Client) FailHealthCheck(ctx context.Context) error
- func (c *Client) GetConfigDump(ctx context.Context, queryParams map[string]string) (*adminv3.ConfigDump, error)
- func (c *Client) GetServerInfo(ctx context.Context) (*adminv3.ServerInfo, error)
- func (c *Client) GetSingleListenerFromDynamicListeners(ctx context.Context, listenerNameRegex string) (*listenerv3.Listener, error)
- func (c *Client) GetStaticClusters(ctx context.Context) (map[string]*clusterv3.Cluster, error)
- func (c *Client) GetStats(ctx context.Context) (string, error)
- func (c *Client) ListenersCmd(ctx context.Context) cmdutils.Cmd
- func (c *Client) ModifyRuntimeConfiguration(ctx context.Context, queryParameters map[string]string) error
- func (c *Client) PassHealthCheck(ctx context.Context) error
- func (c *Client) RequestPathCmd(ctx context.Context, path string) cmdutils.Cmd
- func (c *Client) RunCommand(ctx context.Context, options ...curl.Option) error
- func (c *Client) SetLogLevel(ctx context.Context, logLevel string) error
- func (c *Client) ShutdownServer(ctx context.Context) error
- func (c *Client) StatsCmd(ctx context.Context) cmdutils.Cmd
- func (c *Client) WithCurlOptions(options ...curl.Option) *Client
- func (c *Client) WithReceiver(receiver io.Writer) *Client
Constants ¶
const ( ConfigDumpPath = "config_dump" StatsPath = "stats" ClustersPath = "clusters" ListenersPath = "listeners" ModifyRuntimePath = "runtime_modify" ShutdownServerPath = "quitquitquit" HealthCheckPath = "healthcheck" LoggingPath = "logging" ServerInfoPath = "server_info" DefaultAdminPort = 19000 )
Variables ¶
This section is empty.
Functions ¶
func GetStaticClustersByName ¶
GetStaticClustersByName returns a map of static clusters, indexed by their name If there are no static clusters present, an empty map is returned An error is returned if any conversion fails
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a utility for executing requests against the Envoy Admin API The Admin API handlers can be found here: https://github.com/envoyproxy/envoy/blob/63bc9b564b1a76a22a0d029bcac35abeffff2a61/source/server/admin/admin.cc#L127
func NewClient ¶
func NewClient() *Client
NewClient returns an implementation of the admincli.Client
func (*Client) ClustersCmd ¶
ClustersCmd returns the cmdutils.Cmd that can be run to request data from the clusters endpoint
func (*Client) Command ¶
Command returns a curl Command, using the provided curl.Option as well as the client.curlOptions
func (*Client) ConfigDumpCmd ¶
ConfigDumpCmd returns the cmdutils.Cmd that can be run to request data from the config_dump endpoint
func (*Client) FailHealthCheck ¶
FailHealthCheck calls the endpoint to have the server start failing health checks
func (*Client) GetConfigDump ¶
func (c *Client) GetConfigDump(ctx context.Context, queryParams map[string]string) (*adminv3.ConfigDump, error)
GetConfigDump returns the structured data that is available at the config_dump endpoint
func (*Client) GetServerInfo ¶
GetServerInfo calls the endpoint to return the info for the server
func (*Client) GetSingleListenerFromDynamicListeners ¶
func (c *Client) GetSingleListenerFromDynamicListeners( ctx context.Context, listenerNameRegex string, ) (*listenerv3.Listener, error)
GetSingleListenerFromDynamicListeners queries for a single, active dynamic listener in the envoy config dump and returns it as an envoy v3.Listener. This helper will only work if the provided name_regex matches a single dynamic_listener but will always use the first set of configs returned regardless
func (*Client) GetStaticClusters ¶
GetStaticClusters returns the map of static clusters available on a ConfigDump, indexed by their name
func (*Client) ListenersCmd ¶
ListenersCmd returns the cmdutils.Cmd that can be run to request data from the listeners endpoint
func (*Client) ModifyRuntimeConfiguration ¶
func (c *Client) ModifyRuntimeConfiguration(ctx context.Context, queryParameters map[string]string) error
ModifyRuntimeConfiguration passes the queryParameters to the runtime_modify endpoint
func (*Client) PassHealthCheck ¶
PassHealthCheck calls the endpoint to have the server start passing health checks
func (*Client) RequestPathCmd ¶
RequestPathCmd returns the cmdutils.Cmd that can be run, and will execute a request against the provided path
func (*Client) RunCommand ¶
RunCommand executes a curl Command, using the provided curl.Option as well as the client.curlOptions
func (*Client) SetLogLevel ¶
SetLogLevel calls the endpoint to change the log level for the server
func (*Client) ShutdownServer ¶
ShutdownServer calls the shutdown server endpoint
func (*Client) StatsCmd ¶
StatsCmd returns the cmdutils.Cmd that can be run to request data from the stats endpoint
func (*Client) WithCurlOptions ¶
WithCurlOptions sets the default set of curl.Option that will be used by default with the cmdutils.Cmd created by the Client