config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientPath

func ClientPath(id string) (string, error)

ClientPath get CLI config file from id.

func GetClientFromID

func GetClientFromID(id string) (*client.Client, error)

GetClientFromID loads Client from file according to the id.

Types

type ClientConfig

type ClientConfig struct {
	GwIP             string `json:"gwIp"`
	GwPort           uint16 `json:"gwPort"`
	ID               string `json:"id"`
	CaFile           string `json:"caFile"`
	CertFile         string `json:"certFile"`
	KeyFile          string `json:"keyFile"`
	Dataplane        string `json:"dataplane"`
	PolicyEngineIP   string `json:"policyEngineIp"`
	MetricsManagerIP string `json:"metricsManagerIp"`
	// contains filtered or unexported fields
}

ClientConfig contain all Client configuration to send requests to the GW.

func GetConfigFromID

func GetConfigFromID(id string) (*ClientConfig, error)

GetConfigFromID return configuration of Client according to the Client ID.

func NewClientConfig

func NewClientConfig(cfg *ClientConfig) (*ClientConfig, error)

NewClientConfig create config file with all the configuration of the Client.

func (*ClientConfig) GetCaFile

func (c *ClientConfig) GetCaFile() string

GetCaFile return the Client certificate Authority.

func (*ClientConfig) GetCert

func (c *ClientConfig) GetCert() string

GetCert return the Client certificate.

func (*ClientConfig) GetDataplane

func (c *ClientConfig) GetDataplane() string

GetDataplane return the Client dataplane type (MTLS or TCP).

func (*ClientConfig) GetGwIP

func (c *ClientConfig) GetGwIP() string

GetGwIP return the gw IP that the Client is connected.

func (*ClientConfig) GetGwPort

func (c *ClientConfig) GetGwPort() uint16

GetGwPort return the gw port that the Client is connected.

func (*ClientConfig) GetID

func (c *ClientConfig) GetID() string

GetID return the Client ID.

func (*ClientConfig) GetKeyFile

func (c *ClientConfig) GetKeyFile() string

GetKeyFile return the Client key file.

func (*ClientConfig) GetMetricsManagerIP

func (c *ClientConfig) GetMetricsManagerIP() string

GetMetricsManagerIP return the metrics manager address.

func (*ClientConfig) GetPolicyEngineIP

func (c *ClientConfig) GetPolicyEngineIP() string

GetPolicyEngineIP return the policy server address.

func (*ClientConfig) SetDefaultClient

func (c *ClientConfig) SetDefaultClient(id string) error

SetDefaultClient set the default Client the CLI will use.

Jump to

Keyboard shortcuts

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