util

package
v0.0.0-...-d5a1baf Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InternalError = runtime.NewError("Internal Server Error", 500)
)

Functions

func Extract

func Extract(ctx context.Context, encoding b3.Encoding) context.Context

func Inject

func Inject(ctx context.Context, encoding b3.Encoding) map[string]interface{}

func NewConfig

func NewConfig(ctx context.Context, logger runtime.Logger) error

func NewOpenTelemetry

func NewOpenTelemetry(ctx context.Context, logger runtime.Logger) func()

func RedpandaSend

func RedpandaSend(ctx context.Context, logger runtime.Logger, payload map[string]interface{}) error

Types

type Config

type Config struct {
	InstrumentationName string `` /* 215-byte string literal not displayed */
	JaegerURL           string `` /* 189-byte string literal not displayed */
	RedpandaURL         string `` /* 200-byte string literal not displayed */
	ServiceInstanceId   string `` /* 230-byte string literal not displayed */
	ServiceName         string `` /* 183-byte string literal not displayed */
	ServiceNamespace    string `` /* 192-byte string literal not displayed */
	ServiceVersion      string `` /* 184-byte string literal not displayed */
	Test                bool   `` /* 126-byte string literal not displayed */
}
var ModuleConfig Config

type Key

type Key struct {
	Node string `json:"node,omitempty" protobuf:"bytes,1,opt,name=node,json=node,proto3"`
}

type NakamaContext

type NakamaContext struct {
	ClientIp       string            `json:"client_ip,omitempty" protobuf:"bytes,1,opt,name=client_ip,json=client_ip,proto3"`
	ClientPort     string            `json:"client_port,omitempty" protobuf:"bytes,2,opt,name=client_port,json=client_port,proto3"`
	Env            map[string]string `` /* 156-byte string literal not displayed */
	ExecutionMode  string            `json:"execution_mode,omitempty" protobuf:"bytes,4,opt,name=execution_mode,json=execution_mode,proto3"`
	Headers        map[string]string `` /* 168-byte string literal not displayed */
	Lang           string            `json:"lang,omitempty" protobuf:"bytes,6,opt,name=lang,json=lang,proto3"`
	MatchId        string            `json:"match_id,omitempty" protobuf:"bytes,7,opt,name=match_id,json=match_id,proto3"`
	MatchLabel     string            `json:"match_label,omitempty" protobuf:"bytes,8,opt,name=match_label,json=match_label,proto3"`
	MatchNode      string            `json:"match_node,omitempty" protobuf:"bytes,9,opt,name=match_node,json=match_node,proto3"`
	MatchTickRate  int               `json:"match_tick_rate,omitempty" protobuf:"bytes,10,opt,name=match_tick_rate,json=match_tick_rate,proto3"`
	Node           string            `json:"node,omitempty" protobuf:"bytes,11,opt,name=node,json=node,proto3"`
	QueryParams    map[string]string `` /* 184-byte string literal not displayed */
	SessionId      string            `json:"session_id,omitempty" protobuf:"bytes,13,opt,name=session_id,json=session_id,proto3"`
	UserId         string            `json:"user_id,omitempty" protobuf:"bytes,14,opt,name=user_id,json=user_id,proto3"`
	UserSessionExp int               `json:"user_session_exp,omitempty" protobuf:"bytes,15,opt,name=user_session_exp,json=user_session_exp,proto3"`
	Username       string            `json:"username,omitempty" protobuf:"bytes,16,opt,name=username,json=username,proto3"`
	Vars           map[string]string `` /* 160-byte string literal not displayed */
}

func NewContext

func NewContext(ctx context.Context, logger runtime.Logger) *NakamaContext

type Record

type Record struct {
	Key       Key   `json:"key,omitempty" protobuf:"bytes,1,opt,name=key,json=key,proto3"`
	Partition int   `json:"partition,omitempty" protobuf:"varint,2,opt,name=partition,json=partition,proto3"`
	Value     Value `json:"value,omitempty" protobuf:"bytes,3,opt,name=value,json=value,proto3"`
}

type Records

type Records struct {
	Records []Record `json:"records,omitempty" protobuf:"bytes,1,rep,name=records,json=records,proto3"`
}

type Value

type Value struct {
	B3      string                 `json:"b3,omitempty" protobuf:"bytes,1,opt,name=b3,json=b3,proto3"`
	Payload map[string]interface{} `` /* 182-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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