change

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 5

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"
	SourceTypeXt             = "xt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author added in v0.23.1

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

type AuthorType added in v0.23.1

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 (*Context) AddToContext

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

func (*Context) GetAuthor added in v0.23.1

func (self *Context) GetAuthor() *Author

func (*Context) GetContext

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

func (*Context) GetSource added in v0.23.1

func (self *Context) GetSource() *Source

func (*Context) NewMutateContext

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

func (*Context) PopulateMetadata added in v0.23.1

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 added in v0.23.1

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

func (*Context) SetSourceLocal added in v0.23.1

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

func (*Context) SetSourceMethod added in v0.23.1

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

func (*Context) SetSourceRemote added in v0.23.1

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

func (*Context) SetSourceType added in v0.23.1

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:"local_addr,omitempty"`
	RemoteAddr string `json:"remote_addr,omitempty"`
	Method     string `json:"method,omitempty"`
}

Jump to

Keyboard shortcuts

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