Documentation
¶
Index ¶
- Constants
- func BirdBGPConfigDirFromCtx(ctx context.Context) (string, error)
- func BirdControlSocketFromCtx(ctx context.Context) (string, error)
- func BoolPtr(b bool) *bool
- func CheckVRFDiff(handle *netlink.Handle, link netlink.Link, vrfName *string) (*string, error)
- func CompareBoolPointers(lhs, rhs *bool) bool
- func CompareInt64Pointers(lhs, rhs *int64) bool
- func CompareIntPointers(lhs, rhs *int) bool
- func CompareStringPointers(lhs, rhs *string) bool
- func CompareStringSlices(lhs, rhs []string) bool
- func DiffSets(lhs, rhs map[string]interface{}) (map[string]interface{}, map[string]interface{})
- func DockerCliFromCtx(ctx context.Context) (*client.Client, error)
- func FetchHTTPConfig(url string, tlsConfig *tls.Config, username, password string) (io.Reader, error)
- func FetchHTTPConfigReadCloser(url string, tlsConfig *tls.Config, username, password string) (io.ReadCloser, error)
- func GetContainerNSPid(ctx context.Context, cli *client.Client, containerName string) (*int, error)
- func GetCustomResolver(resolverEndpoint string) (*net.Resolver, error)
- func GetNetNSHandle(ctx context.Context, cli *client.Client, containerName string) (netns.NsHandle, error)
- func GetRandomFreeUDPPort() (int, error)
- func GetStatefulDir(ctx context.Context) string
- func GetTLSConfig(caCertPath, clientCertPath, clientKeyPath string) (*tls.Config, error)
- func IntPtr(i int) *int
- func IsAllZeroKey(key wgtypes.Key) bool
- func IsIPNetListNotEqu(lhs, rhs []net.IPNet) bool
- func NewURLReader(url string, options *URLReaderTransportOptions) (io.ReadCloser, error)
- func NodeNameFromCtx(ctx context.Context) (string, error)
- func NormalizeContainerName(containerName string) string
- func ParseKVPairs(sep string, raw string) map[string]string
- func ResolvePath(path string) string
- func ResolverEndpointFromCtx(ctx context.Context) (string, error)
- func SetBirdBGPConfigDirInCtx(ctx context.Context, configDir string) context.Context
- func SetBirdControlSocketInCtx(ctx context.Context, controlSocket string) context.Context
- func SetClientAuthInCtx(ctx context.Context, clientAuth *ClientAuth) context.Context
- func SetDockerCliInCtx(ctx context.Context, cli *client.Client) context.Context
- func SetNodeNameInCtx(ctx context.Context, nodeName string) context.Context
- func SetResolverEndpointInCtx(ctx context.Context, resolverEndpoint string) context.Context
- func SetServiceNameInCtx(ctx context.Context, serviceName string) context.Context
- func SetStartedAtInCtx(ctx context.Context, startedAt uint64) context.Context
- func SetStatefulDirInCtx(ctx context.Context, statefulDir string) context.Context
- func SetUnixSocketPathInCtx(ctx context.Context, unixSocketPath string) context.Context
- func SetV6AvailableInCtx(ctx context.Context, v6Available bool) context.Context
- func SetVersionMetadataInCtx(ctx context.Context, versionMetadata map[string]string) context.Context
- func StartedAtFromCtx(ctx context.Context) (uint64, error)
- func StatefulDirFromCtx(ctx context.Context) (string, error)
- func StringPtr(s string) *string
- func TrySetVRF(handle *netlink.Handle, link netlink.Link, vrfName *string) error
- func Uint16Ptr(i uint16) *uint16
- func UnixSocketPathFromCtx(ctx context.Context) (string, error)
- func V6AvailableFromCtx(ctx context.Context) (bool, error)
- func VersionMetadataFromCtx(ctx context.Context) (map[string]string, error)
- func WithFullMask(ip *string) *string
- func WithFullMaskIPNet(ipObj net.IP) *net.IPNet
- type BasicInfo
- type ClientAuth
- type ContainerKey
- type CtxKey
- type URLReader
- type URLReaderTransportOptions
Constants ¶
View Source
const DefaultVRFIndex int = 0
If the master index of a link is 0, we consider its VRF as default VRF
View Source
const FilePathPresumedToBeStdin = "-"
View Source
const FilePathThatIsStdin = "/dev/stdin"
View Source
const VRFNameDefault = "default"
View Source
const VRFNameEmpty = ""
Variables ¶
This section is empty.
Functions ¶
func CheckVRFDiff ¶
Returns: (vrfNameToSet, error)
func CompareBoolPointers ¶
func CompareInt64Pointers ¶
func CompareIntPointers ¶
func CompareStringPointers ¶
func CompareStringSlices ¶
func DiffSets ¶
returns: (added, removed) added is those in lhs but not rhs, removed is those in rhs but not lhs
func FetchHTTPConfig ¶
func FetchHTTPConfig(url string, tlsConfig *tls.Config, username, password string) (io.Reader, error)
FetchHTTPConfig fetches configuration from an HTTP(S) endpoint
func FetchHTTPConfigReadCloser ¶
func FetchHTTPConfigReadCloser(url string, tlsConfig *tls.Config, username, password string) (io.ReadCloser, error)
FetchHTTPConfig fetches configuration from an HTTP(S) endpoint
func GetContainerNSPid ¶
func GetNetNSHandle ¶
func GetRandomFreeUDPPort ¶
func GetStatefulDir ¶
func GetTLSConfig ¶
GetTLSConfig creates a TLS configuration from the provided certificate files
func IsAllZeroKey ¶
func IsIPNetListNotEqu ¶
func NewURLReader ¶
func NewURLReader(url string, options *URLReaderTransportOptions) (io.ReadCloser, error)
func NormalizeContainerName ¶
func ResolvePath ¶
func SetClientAuthInCtx ¶
func SetClientAuthInCtx(ctx context.Context, clientAuth *ClientAuth) context.Context
func SetDockerCliInCtx ¶
func SetServiceNameInCtx ¶
func SetStartedAtInCtx ¶
func SetStatefulDirInCtx ¶
func SetUnixSocketPathInCtx ¶
func SetV6AvailableInCtx ¶
func SetVersionMetadataInCtx ¶
func VersionMetadataFromCtx ¶
func WithFullMask ¶
This works the same as WithFullMaskIPNet, except that it's string in and string out.
Types ¶
type BasicInfo ¶
type ClientAuth ¶
type ClientAuth struct {
TLSClientCertFile string
TLSClientKeyFile string
TLSTrustedCACertFile string
HTTPBasicAuthUsername string
HTTPBasicAuthPassword string
}
func ClientAuthFromCtx ¶
func ClientAuthFromCtx(ctx context.Context) (*ClientAuth, error)
type CtxKey ¶
type CtxKey string
const CtxKeyBirdBGPConfigDir CtxKey = "bird_bgp_config_dir"
const CtxKeyBirdControlSocket CtxKey = "bird_control_socket"
const CtxKeyClientAuth CtxKey = "client_auth"
const CtxKeyNodeName CtxKey = "node_name"
const CtxKeyResolverEndpoint CtxKey = "resolver_endpoint"
const CtxKeyStartedAt CtxKey = "started_at"
const CtxKeyUnixSocketPath CtxKey = "unix_socket_path"
const CtxKeyV6Available CtxKey = "v6_available"
const CtxKeyVersionMetadata CtxKey = "version_metadata"
Click to show internal directories.
Click to hide internal directories.