change

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextKey ContextKeyType = "changeContext"

	AuthorIdKey   = "authorId"
	AuthorNameKey = "authorName"
	AuthorTypeKey = "authorType"
	TraceIdKey    = "traceId"
	SourceType    = "src.type"
	SourceAuth    = "src.auth"
	SourceMethod  = "src.method"
	SourceLocal   = "src.local"
	SourceRemote  = "src.remote"
)
View Source
const (
	AuthorTypeCert         = "cert"
	AuthorTypeIdentity     = "identity"
	AuthorTypeRouter       = "router"
	AuthorTypeController   = "controller"
	AuthorTypeUnattributed = "unattributed"
)
View Source
const (
	SourceTypeControlChannel = "ctrl.channel"
	SourceTypeRest           = "rest"
	SourceTypeWebSocket      = "websocket"
	SourceTypeXt             = "xt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Type string `json:"type"`
	Id   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type AuthorType

type AuthorType string

type Context

type Context struct {
	Attributes map[string]string
	RaftIndex  uint64
}

func FromContext

func FromContext(ctx context.Context) *Context

func FromProtoBuf

func FromProtoBuf(ctx *cmd_pb.ChangeContext) *Context

func New

func New() *Context

func NewControlChannelChange added in v0.33.0

func NewControlChannelChange(routerId, routerName, method string, ch channel.Channel) *Context

func (*Context) AddToContext

func (self *Context) AddToContext(ctx context.Context) context.Context

func (*Context) GetAuthor

func (self *Context) GetAuthor() *Author

func (*Context) GetContext

func (self *Context) GetContext() context.Context

func (*Context) GetSource

func (self *Context) GetSource() *Source

func (*Context) NewMutateContext

func (self *Context) NewMutateContext() boltz.MutateContext

func (*Context) PopulateMetadata

func (self *Context) PopulateMetadata(meta map[string]any)

func (*Context) SetChangeAuthorId

func (self *Context) SetChangeAuthorId(val string) *Context

func (*Context) SetChangeAuthorName

func (self *Context) SetChangeAuthorName(val string) *Context

func (*Context) SetChangeAuthorType

func (self *Context) SetChangeAuthorType(val AuthorType) *Context

func (*Context) SetSourceAuth

func (self *Context) SetSourceAuth(val string) *Context

func (*Context) SetSourceLocal

func (self *Context) SetSourceLocal(val string) *Context

func (*Context) SetSourceMethod

func (self *Context) SetSourceMethod(val string) *Context

func (*Context) SetSourceRemote

func (self *Context) SetSourceRemote(val string) *Context

func (*Context) SetSourceType

func (self *Context) SetSourceType(val string) *Context

func (*Context) SetTraceId

func (self *Context) SetTraceId(val string) *Context

func (*Context) ToProtoBuf

func (self *Context) ToProtoBuf() *cmd_pb.ChangeContext

type ContextKeyType

type ContextKeyType string

type Source

type Source struct {
	Type       string `json:"type"`
	Auth       string `json:"auth,omitempty"`
	LocalAddr  string `json:"localAddr,omitempty"`
	RemoteAddr string `json:"remoteAddr,omitempty"`
	Method     string `json:"method,omitempty"`
}

Jump to

Keyboard shortcuts

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