util

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 24 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DedupRegistrationEntries

func DedupRegistrationEntries(entries []*common.RegistrationEntry) []*common.RegistrationEntry

func DeriveRegEntryhash

func DeriveRegEntryhash(entry *common.RegistrationEntry) (key string)

func LoadCertPool

func LoadCertPool(path string) (*x509.CertPool, error)

LoadCertPool loads one or more certificates into an *x509.CertPool from a PEM file on disk.

func LoadCertificates

func LoadCertificates(path string) ([]*x509.Certificate, error)

LoadCertificates loads one or more certificates into an []*x509.Certificate from a PEM file on disk.

func MakeCSR

func MakeCSR(privateKey interface{}, spiffeID string) ([]byte, error)

func MakeCSRWithoutURISAN

func MakeCSRWithoutURISAN(privateKey interface{}) ([]byte, error)

func NewCertPool

func NewCertPool(certs ...*x509.Certificate) *x509.CertPool

NewCertPool creates a new *x509.CertPool based on the certificates given as parameters.

func RunTasks

func RunTasks(ctx context.Context, tasks ...func(context.Context) error) error

RunTasks executes all of the provided functions concurrently and waits for them all to complete. If a function returns an error, all other functions are canceled (i.e. the context they are passed is canceled) and the error is returned. If all functions finish to completion successfully, RunTasks returns nil. If the context passed to RunTasks is canceled then each function is canceled and RunTasks returns ctx.Err(). Tasks passed to RunTasks MUST support cancelation via the provided context for RunTasks to work properly.

func SignalListener

func SignalListener(ctx context.Context, cancel func())

func SortRegistrationEntries

func SortRegistrationEntries(entries []*common.RegistrationEntry)

func SortSelectors

func SortSelectors(selectors []*common.Selector)

func SortTypesEntries added in v0.12.0

func SortTypesEntries(entries []*types.Entry)

func SortTypesSelectors added in v0.12.0

func SortTypesSelectors(selectors []*types.Selector)

Types

This section is empty.

Jump to

Keyboard shortcuts

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