shared

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetServiceName

func SetServiceName(name string)

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context is our implementation of context.Context

func NewCustomContext

func NewCustomContext() *Context

NewCustomContext initializes a new custom context

func (*Context) Cancel

func (c *Context) Cancel(err error)

Cancel closes the context and sets an error

func (*Context) Deadline

func (c *Context) Deadline() (time.Time, bool)

Deadline returns no deadline (false)

func (*Context) Done

func (c *Context) Done() <-chan struct{}

Done returns a channel that is closed when the context is canceled

func (*Context) Err

func (c *Context) Err() error

Err returns the error if the context is canceled

func (*Context) Logs

func (c *Context) Logs() []map[string]interface{}

func (*Context) Range

func (c *Context) Range(f func(key, value interface{}) bool)

Range iterates over all key-value pairs

func (*Context) Value

func (c *Context) Value(key interface{}) interface{}

Value retrieves a value by key

func (*Context) WithLog

func (c *Context) WithLog(value map[string]interface{})

func (*Context) WithValue

func (c *Context) WithValue(key, value interface{})

WithValue sets a key-value pair

type Secret

type Secret struct {
	Value string
}

func NewSecret

func NewSecret(value string) Secret

func (Secret) String

func (s Secret) String() string

type ServiceName

type ServiceName string

func GetServiceName

func GetServiceName() ServiceName

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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