util

package
v0.0.0-...-e8c0e37 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commit

func Commit() string

func CreateSecret

func CreateSecret(sid string, plaintext string) error

CreateSecret will create a secret with id sid and write the plaintext into it

func GetContentLength

func GetContentLength(url string) (int64, error)

GetContentLength gets the size of a URL without downloading it

func GetSigningEntity

func GetSigningEntity(kid uint64) (*openpgp.Entity, error)

GetSigningEntity gets the public keyring from gpg, using the agent Needs the gpgconf binary to find the agent socket path as gpg doesn't seem to set GPG_AUTH_INFO anymore.

func Md5Sum

func Md5Sum(f *os.File) string

MD5Sum returns "" if there is a problem computing the sum

func Name

func Name() string

func Sha256Sum

func Sha256Sum(f *os.File) string

Sha256Sum returns "" if there is a problem computing the sum

func StatCount

func StatCount(metric string, value int)

func StatGauge

func StatGauge(metric string, value int)

func StatTime

func StatTime(metric string, took time.Duration)

func UpdateSecret

func UpdateSecret(sid string, plaintext string) error

UpdateSecret will write the plaintext into the AWS Secrets Manager secret referred to by sid

func Version

func Version() string

Types

type Set

type Set[T cmp.Ordered] map[T]struct{}

QADI of sets that have a stable sort

func NewSetFromSlices

func NewSetFromSlices[T cmp.Ordered](vals ...[]T) Set[T]

newSetFromSlices takes slices creates a set with their contents

func (Set[T]) Add

func (s Set[T]) Add(vals ...T)

func (Set[T]) Has

func (s Set[T]) Has(val T) bool

func (Set[T]) Members

func (s Set[T]) Members() []T

type TLSAuthClient

type TLSAuthClient struct {
	CA   []byte
	Cert []byte
	Key  []byte
}

func (*TLSAuthClient) GetHTTPSClient

func (auth *TLSAuthClient) GetHTTPSClient() (http.Client, error)

func (*TLSAuthClient) GetTLSConfig

func (auth *TLSAuthClient) GetTLSConfig() (*tls.Config, error)

GetTLSConfig returns a tls config object to be used by mTLS HTTP/ETCD clients etc.

func (*TLSAuthClient) String

func (auth *TLSAuthClient) String() string

String implements Stringer for printing

Directories

Path Synopsis
Package gpgagent interacts with the local GPG Agent.
Package gpgagent interacts with the local GPG Agent.

Jump to

Keyboard shortcuts

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