context

package
v0.0.0-...-1ba95a4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
	Environ     Environment
	ProjectInfo tenant.ProjectInfo
	// contains filtered or unexported fields
}

Context is used to in dm to record some context field like * go context

func Background

func Background() *Context

Background return a nop context.

func NewContext

func NewContext(ctx context.Context) *Context

NewContext return a new Context.

func (*Context) Deps

func (c *Context) Deps() *deps.Deps

Deps returns a handle used for dependency injection.

func (*Context) WithContext

func (c *Context) WithContext(ctx context.Context) *Context

WithContext set go context.

func (*Context) WithDeps

func (c *Context) WithDeps(deps *deps.Deps) *Context

WithDeps puts a built dependency container into the context.

func (*Context) WithTimeout

func (c *Context) WithTimeout(timeout time.Duration) (*Context, context.CancelFunc)

WithTimeout sets a timeout associated context.

type Environment

type Environment struct {
	NodeID          p2p.NodeID
	Addr            string
	MasterMetaBytes []byte
}

Environment contains some configuration related environ values

Jump to

Keyboard shortcuts

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