ccontext

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Callback = "callback"
)

Variables

This section is empty.

Functions

func WithApiErrCode

func WithApiErrCode(ctx context.Context, cb ApiErrCodeCallback) context.Context

func WithInfo

func WithInfo(ctx context.Context, conf *GlobalConfig) context.Context

func WithOperationID

func WithOperationID(ctx context.Context, operationID string) context.Context

Types

type ApiErrCodeCallback

type ApiErrCodeCallback interface {
	OnError(ctx context.Context, err error)
}

func GetApiErrCodeCallback

func GetApiErrCodeCallback(ctx context.Context) ApiErrCodeCallback

type ContextInfo

type ContextInfo interface {
	UserID() string
	Token() string
	PlatformID() int32
	ApiAddr() string
	WsAddr() string
	DataDir() string
	LogLevel() uint32
	OperationID() string
	IsExternalExtensions() bool
}

func Info

func Info(ctx context.Context) ContextInfo

type GlobalConfig

type GlobalConfig struct {
	UserID string
	Token  string

	sdk_struct.IMConfig
}

type GlobalConfigKey

type GlobalConfigKey struct{}

Jump to

Keyboard shortcuts

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