client

package
v0.0.0-...-fe05e01 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VersionTLSDefaultMin = tls.VersionTLS12
	VersionTLSDefaultMax = tls.VersionTLS13
)
View Source
const DefaultIPv4 = "127.0.0.1"
View Source
const DefaultPort = 3000

Variables

This section is empty.

Functions

func LoadCACerts

func LoadCACerts(certsBytes [][]byte) *x509.CertPool

LoadCACerts returns CA set of certificates (cert pool) reads CA certificate based on the certConfig and adds it to the pool

func LoadServerCertAndKey

func LoadServerCertAndKey(certFileBytes, keyFileBytes, keyPassBytes []byte) ([]tls.Certificate, error)

LoadServerCertAndKey reads server certificate and associated key file based on certConfig and keyConfig returns parsed server certificate if the private key is encrypted, it will be decrypted using key file passphrase

Types

type AerospikeConfig

type AerospikeConfig struct {
	Seeds    HostTLSPortSlice
	User     string
	Password string
	AuthMode as.AuthMode
	TLS      *TLSConfig
}

AerospikeConfig represents the intermediate configuration for an Aerospike client. This can be constructed directly using flags.AerospikeFlags or

func NewDefaultAerospikeConfig

func NewDefaultAerospikeConfig() *AerospikeConfig

NewDefaultAerospikeConfig creates a new default AerospikeConfig instance.

func (*AerospikeConfig) NewClientPolicy

func (ac *AerospikeConfig) NewClientPolicy() (*as.ClientPolicy, error)

NewClientPolicy creates a new Aerospike client policy based on the AerospikeConfig.

func (*AerospikeConfig) NewHosts

func (ac *AerospikeConfig) NewHosts() []*as.Host

type HostTLSPort

type HostTLSPort struct {
	Host    string // Can be ipv4, ipv6, or hostname.
	TLSName string
	Port    int
}

func NewDefaultHostTLSPort

func NewDefaultHostTLSPort() *HostTLSPort

func NewHostTLSPort

func NewHostTLSPort() *HostTLSPort

func (*HostTLSPort) String

func (addr *HostTLSPort) String() string

type HostTLSPortSlice

type HostTLSPortSlice []*HostTLSPort

func (*HostTLSPortSlice) String

func (slice *HostTLSPortSlice) String() string

type TLSConfig

type TLSConfig struct {
	RootCA                 [][]byte
	Cert                   []byte
	Key                    []byte
	KeyPass                []byte
	TLSProtocolsMinVersion TLSProtocol
	TLSProtocolsMaxVersion TLSProtocol
}

TLSConfig is a struct that holds the TLS configuration for the client. It is an intermediate type that integrates nicely with our flags.

func NewTLSConfig

func NewTLSConfig(rootCA [][]byte, cert, key, keyPass []byte, min, max TLSProtocol) *TLSConfig

NewTLSConfig returns a new TLSConfig that can later be used to create a tls.Config that can be passed to a go client. It is a intermediate type that integrates nicely with our flags.

func (*TLSConfig) NewGoTLSConfig

func (tc *TLSConfig) NewGoTLSConfig() (*tls.Config, error)

type TLSProtocol

type TLSProtocol uint16

func (TLSProtocol) String

func (p TLSProtocol) String() string

Jump to

Keyboard shortcuts

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