common

package
v0.2.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ContextKeyAPIRequestInfo  = "_api_request_info"
	ContextKeyAPIResponseInfo = "_api_response_info"
	ContextKeyAPIError        = "_api_error"

	ContextKeyCredential = "_credential"
	ContextKeySession    = "_session"
	ContextKeyNamespace  = "_namespace"
	ContextKeyDB         = "_db"
	ContextKeyTX         = "_tx"
	ContextKeyLogger     = "_logger"
	ContextKeyTrace      = "_trace"
)
View Source
const (
	RedactMask = "REDACTED XXXX"
)
View Source
const (
	TimeFormat = "2006-01-02 15:04:05.00"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon interface {
	Start(ctx context.Context) error
	Stop(wait bool) error
}

type Debuggable

type Debuggable interface {
	Info(w io.Writer, debug bool)
}

type Event

type Event interface {
	Kind() string
}

type EventHandler

type EventHandler interface {
	HandleEvent(e Event) error
}

type EventSender

type EventSender interface {
	SendEvent(ctx context.Context, from Named, message Event)
}

type Initializable

type Initializable interface {
	Init() error
}

type Named

type Named interface {
	Name() string
}

type Pair

type Pair[K comparable, V any] interface {
	SetKey(key K)
	SetValue(value V)
	GetKey() K
	GetValue() V
	String() string
}

func NewPair

func NewPair[K comparable, V any](key K, value V) Pair[K, V]

func ParsePair

func ParsePair(s string) (Pair[string, string], bool)

type Pairs

type Pairs []Pair[string, string]

func NewPairs

func NewPairs[T Pair[string, string]](src []T) Pairs

func ParsePairs

func ParsePairs(s string) (Pairs, bool)

func ParsePairsMap

func ParsePairsMap(m map[string]string) Pairs

func (Pairs) Map

func (p Pairs) Map() map[string]string

func (Pairs) String

func (p Pairs) String() string

type RawEventHandler

type RawEventHandler interface {
	HandleRawEvent(kind string, payload any) error
}

type RawEventSender

type RawEventSender interface {
	SendRawEvent(ctx context.Context, from Named, kind string, payload any)
}

type Service

type Service interface {
	Named
	Dependencies() []Service
}

type Unique

type Unique interface {
	Key() string
}

type Weighted

type Weighted interface {
	GetPriority() int
	SetPriority(priority int)
}

Jump to

Keyboard shortcuts

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