Documentation
¶
Overview ¶
JSON Pointer utilities see: https://datatracker.ietf.org/doc/html/rfc6901
This implementation does not strive to be a perfect implementation of RFC6901. Is is only good enough for the needs of uniond.
Index ¶
- Constants
- Variables
- func AssertDirectory(mode fs.FileMode, path string)
- func AssertFile(filePath string) *os.File
- func CloseAll(ctx context.Context, closers ...*CloseHook) []error
- func ContextValueAs[A any](ctx context.Context, key any) (*A, error)
- func ExecCommand(cmd *Command, argv []string) error
- func ExecCommandContext(ctx SignalContext, cmd *Command, argv []string) error
- func GeneratePassword() string
- func GetFunctionName(function any) string
- func GroupBy[A any](slice []A, toKey func(A) string) map[string][]A
- func HashPassword(password string) ([]byte, error)
- func LogServiceInit()
- func Merge[T any](a T, b T) T
- func NewCert(key *ecdsa.PrivateKey) (cert tls.Certificate, signingKey *ecdsa.PrivateKey, signingKeyPem []byte, ...)
- func NewSelfSignedCertificate(key *ecdsa.PrivateKey) (*tls.Certificate, *ecdsa.PrivateKey, error)
- func Reduce[A any, B any](slice []A, combine func(accumulator B, next A) B) B
- func Run(routine any, modules ...ModuleProvider) (runtimeErr error, closeErrs []error)
- func VerifyPassword(password string, hash []byte) error
- type AnySlice
- type CloseHook
- type Closer
- type Closers
- type Command
- type ContextGetters
- type ContextValue
- type ContextValues
- type Element
- type Equals
- type ErrorOr
- type Hashable
- type InitHook
- type Initializer
- type Initializers
- type List
- type M
- type Module
- type ModuleProvider
- type Set
- type SignalContext
- type StringStringer
- type Table
- type Ulid
- func (ulid *Ulid) BitString() string
- func (ulid *Ulid) Bytes() []byte
- func (ulid *Ulid) EntropyBytes() []byte
- func (ulid *Ulid) Equals(other *Ulid) bool
- func (ulid *Ulid) MarshalJSON() ([]byte, error)
- func (ulid *Ulid) String() string
- func (ulid *Ulid) Time() *time.Time
- func (ulid *Ulid) TimeBytes() []byte
- func (ulid *Ulid) UnmarshalJSON(data []byte) error
- type VirtualFS
Constants ¶
View Source
const ( UlidByteSize = 16 UlidStringSize = 26 )
View Source
const (
DEFAULT_SELF_SIGNED_CERT_LIFETIME = 365 * 24 * time.Hour
)
Variables ¶
Functions ¶
func AssertDirectory ¶
func AssertFile ¶
func ExecCommand ¶
Top level entry for cli applications
Execute a command with the given command line arguments.
func ExecCommandContext ¶
func ExecCommandContext(ctx SignalContext, cmd *Command, argv []string) error
Top level entry for cli applications
Execute a command with the given command line arguments and the given context.
func GeneratePassword ¶
func GeneratePassword() string
func GetFunctionName ¶
func HashPassword ¶
func LogServiceInit ¶
func LogServiceInit()
func NewCert ¶
func NewCert(key *ecdsa.PrivateKey) (cert tls.Certificate, signingKey *ecdsa.PrivateKey, signingKeyPem []byte, certPem []byte, err error)
func NewSelfSignedCertificate ¶
func NewSelfSignedCertificate(key *ecdsa.PrivateKey) (*tls.Certificate, *ecdsa.PrivateKey, error)
func VerifyPassword ¶
Types ¶
type Command ¶
type ContextGetters ¶
type ContextGetters struct {
dig.In
ContextValues []ContextValue `group:"contextValues"`
}
type ContextValues ¶
type ContextValues struct {
dig.Out
ContextValues []ContextValue `group:"contextValues,flatten"`
}
type Initializer ¶
func NilInit ¶
func NilInit() Initializer
type Initializers ¶
type Module ¶
type Module interface {
Sub(provider ModuleProvider)
Public(service any)
Private(service any)
Run(runtime any) (runtimeErr error, closeErrs []error)
Init([]*InitHook) []error
Finalize([]*CloseHook) []error
// contains filtered or unexported methods
}
func LoadModules ¶
func LoadModules(submodules ...ModuleProvider) Module
type ModuleProvider ¶
type ModuleProvider func(Module)
type Set ¶
type Set[A comparable] interface { Has(a A) bool Add(a A) AddAll(a ...A) Remove(a A) Count() int Values() []A }
func NewSet ¶
func NewSet[A comparable]() Set[A]
type SignalContext ¶
func NewSignalContext ¶
func NewSignalContext() SignalContext
type StringStringer ¶
type StringStringer string
func (StringStringer) String ¶
func (s StringStringer) String() string
type Table ¶
type Table[Record any] struct { Title string Columns []string Records []Record ToRow func(record Record) []any }
func (*Table[Record]) AddRecords ¶
func (table *Table[Record]) AddRecords(records ...Record)
type Ulid ¶
type Ulid struct {
// contains filtered or unexported fields
}
func MustUlidFromString ¶
func NewMonotonicUlid ¶
func NewMonotonicUlid() *Ulid
func UlidFromBytes ¶
func UlidFromString ¶
func UlidFromTime ¶
func (*Ulid) EntropyBytes ¶
func (*Ulid) MarshalJSON ¶
func (*Ulid) UnmarshalJSON ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.