types

package
v0.0.0-...-3659ccf Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddrPort

type AddrPort struct {
	netip.AddrPort
}

AddrPort is a wrapper for netip.AddrPort for which (json/yaml).(Marshaller/Unmarshaller) are implemented.

func ParseAddrPort

func ParseAddrPort(addrPortStr string) (AddrPort, error)

ParseAddrPort parses an IPv4/IPv6 address and port string into an AddrPort.

func (AddrPort) MarshalJSON

func (a AddrPort) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for the AddrPort type.

func (AddrPort) MarshalYAML

func (a AddrPort) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaler for the AddrPort type. Note that for yaml we just need to return a yaml marshallable type (if we return []byte as in the json implementation it is written as an int array).

func (*AddrPort) UnmarshalJSON

func (a *AddrPort) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler for AddrPort.

func (*AddrPort) UnmarshalYAML

func (a *AddrPort) UnmarshalYAML(unmarshal func(v any) error) error

UnmarshalYAML implements yaml.Unmarshaler for AddrPort.

type AddrPorts

type AddrPorts []AddrPort

AddrPorts is a defined type for a slice of AddrPort. This facilitates convenience functions.

func ParseAddrPorts

func ParseAddrPorts(addrPortStrs []string) (AddrPorts, error)

ParseAddrPorts parses a list of IPv4/IPv6 address and port strings into an AddrPorts.

func (AddrPorts) SelectRandom

func (a AddrPorts) SelectRandom() AddrPort

SelectRandom returns a randomly selected AddrPort from AddrPorts.

func (AddrPorts) Strings

func (a AddrPorts) Strings() []string

Strings returns a string slice of the AddrPorts.

type ClusterCertificatePut

type ClusterCertificatePut struct {
	PublicKey  string `json:"public_key"  yaml:"public_key"`
	PrivateKey string `json:"private_key" yaml:"private_key"`
	CA         string `json:"ca"          yaml:"ca"`
}

ClusterCertificatePut represents the content of a new cluster keypair and CA.

type X509Certificate

type X509Certificate struct {
	*x509.Certificate
}

X509Certificate is a json/yaml marshallable/unmarshallable type wrapper for x509.Certificate.

func ParseX509Certificate

func ParseX509Certificate(certStr string) (*X509Certificate, error)

func (X509Certificate) MarshalJSON

func (c X509Certificate) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for X509Certificate.

func (X509Certificate) MarshalYAML

func (c X509Certificate) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaller for X509Certificate.

func (X509Certificate) String

func (c X509Certificate) String() string

String returns the x509.Certificate as a PEM encoded string.

func (*X509Certificate) UnmarshalJSON

func (c *X509Certificate) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler for X509Certificate.

func (*X509Certificate) UnmarshalYAML

func (c *X509Certificate) UnmarshalYAML(unmarshal func(v any) error) error

UnmarshalYAML implements yaml.Unmarshaler for X509Certificate.

Jump to

Keyboard shortcuts

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