storage

package
Version: v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultProfileName = "default"

The name of storage profile to be used as default if nothing was specified.

View Source
const InlinePrefix = "inline:"

Variables

This section is empty.

Functions

func CheckFileNotExist

func CheckFileNotExist(path string) error

func DefaultStoragePath

func DefaultStoragePath() (string, error)

func ReadCertificateFile

func ReadCertificateFile(p string) (*x509.Certificate, error)

func ReadFileOrInlineText added in v0.2.3

func ReadFileOrInlineText(p string) ([]byte, error)

func ReadPrivateKeyFile

func ReadPrivateKeyFile(p string) (crypto.PrivateKey, error)

func VerifyProfileName added in v0.2.2

func VerifyProfileName(name string) error

func WriteCertificateDerFile

func WriteCertificateDerFile(p string, certDer []byte) error

func WriteCertificateFile

func WriteCertificateFile(p string, cert *x509.Certificate) error

func WritePrivateKeyFile

func WritePrivateKeyFile(p string, priv crypto.PrivateKey) error

Types

type CAStatus

type CAStatus struct {
	Profile *Profile
	Code    CAStatusCode
	CACert  *x509.Certificate
	Err     error
}

func (*CAStatus) Error

func (s *CAStatus) Error() string

func (*CAStatus) Unwrap

func (s *CAStatus) Unwrap() error

type CAStatusCode

type CAStatusCode int
const (
	ValidCA CAStatusCode = iota
	NotCA
	Broken
	Expired
	MaxCAStatusCode = Expired
)

func (CAStatusCode) String added in v0.2.3

func (c CAStatusCode) String() string

type Profile

type Profile struct {
	BaseDir string
}

func (*Profile) CACertPath

func (s *Profile) CACertPath() string

func (*Profile) CAPrivateKeyPath

func (s *Profile) CAPrivateKeyPath() string

func (*Profile) IssueDBPath

func (s *Profile) IssueDBPath() string

func (*Profile) Name added in v0.1.0

func (p *Profile) Name() string

func (*Profile) ReadCACertificate

func (s *Profile) ReadCACertificate() (*x509.Certificate, error)

func (*Profile) ReadCAPrivateKey

func (s *Profile) ReadCAPrivateKey() (crypto.PrivateKey, error)

func (*Profile) ReadServerCertificate

func (s *Profile) ReadServerCertificate() (*x509.Certificate, error)

func (*Profile) ReadServerPrivateKey

func (s *Profile) ReadServerPrivateKey() (crypto.PrivateKey, error)

func (*Profile) Status

func (s *Profile) Status(now time.Time) (st *CAStatus)

func (*Profile) String

func (p *Profile) String() string

func (*Profile) WriteCACertificateDer

func (s *Profile) WriteCACertificateDer(certDer []byte) error

func (*Profile) WriteCAPrivateKey

func (s *Profile) WriteCAPrivateKey(priv crypto.PrivateKey) error

func (*Profile) WriteServerCertificate

func (s *Profile) WriteServerCertificate(cert *x509.Certificate) error

func (*Profile) WriteServerPrivateKey

func (s *Profile) WriteServerPrivateKey(priv crypto.PrivateKey) error

type Storage

type Storage struct {
	BaseDir string
}

func New

func New(baseDir string) (*Storage, error)

func (*Storage) ClientCertPath

func (s *Storage) ClientCertPath() string

func (*Storage) ClientPrivateKeyPath

func (s *Storage) ClientPrivateKeyPath() string

func (*Storage) ConnectionInfoPath

func (s *Storage) ConnectionInfoPath() string

func (*Storage) GeoIpCachePath added in v0.1.0

func (s *Storage) GeoIpCachePath() string

func (*Storage) Profile

func (s *Storage) Profile(name string) (*Profile, error)

func (*Storage) Profiles added in v0.1.0

func (s *Storage) Profiles() ([]*Profile, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL