Documentation ¶
Index ¶
- Constants
- func AudienceEquals(a, b *protos.Audience) bool
- func AudienceFromStr(s string) *protos.Audience
- func AudienceInList(audience *protos.Audience, list []*protos.Audience) bool
- func AudienceToStr(audience *protos.Audience) string
- func ConvertPipelineConfigsAudToStr(configs map[*protos.Audience]*protos.PipelineConfigs) map[string]*protos.PipelineConfigs
- func CounterName(name string, labels map[string]string) string
- func CtxMetadata(ctx context.Context) map[string]string
- func CtxRequestId(ctx context.Context) string
- func CtxStringValue(ctx context.Context, key string) string
- func DeterminativeUUID(data []byte, modifier ...string) string
- func GenerateKVRequest(action shared.KVAction, kvs []*protos.KVObject, overwrite bool) *protos.KVRequest
- func GenerateNodeID(installID, nodeName string) string
- func GenerateUUID() string
- func GenerateWasmMapping(commands ...*protos.Command) map[string]*shared.WasmModule
- func GetStepSubType(step *protos.PipelineStep) string
- func GetStepType(step *protos.PipelineStep) string
- func GetWasmIDFromRedisKey(key string) (string, error)
- func GetWasmNameFromKey(key string) (string, error)
- func GrpcMethodCounterName(method string) string
- func NowUnixTsNsUtcPtr() *int64
- func Pointer[T any](val T) *T
- func StandardResponse(ctx context.Context, code protos.ResponseCode, msg string) *protos.StandardResponse
- func StripWASMFields(pipeline *protos.Pipeline)
Constants ¶
const (
GRPCRequestIDMetadataKey = "request-id"
)
Variables ¶
This section is empty.
Functions ¶
func AudienceEquals ¶
func AudienceFromStr ¶
AudienceFromStr will parse a string into an Audience. If the string is invalid, nil will be returned.
func AudienceInList ¶ added in v0.0.23
func AudienceToStr ¶
func ConvertPipelineConfigsAudToStr ¶ added in v0.0.17
func ConvertPipelineConfigsAudToStr(configs map[*protos.Audience]*protos.PipelineConfigs) map[string]*protos.PipelineConfigs
ConvertPipelineConfigsAudToStr is used for converting a map of *protos.Audience:*protos.PipelineConfigs to map of string:*protos.PipelineConfigs.
func CtxMetadata ¶
CtxMetadata will return a map[string]string of the metadata in the given context (if md exists). NOTE: Will use only first value in metadata value slice.
func CtxRequestId ¶
func DeterminativeUUID ¶ added in v0.0.41
DeterminativeUUID generates a deterministic UUID from the given data; accepts an optional modifier string that will be appended to data before hashing.
NOT: Modifier is useful if you already have added Wasm with the same data - CreateWasm() would normally error; you can get around this by passing a unique modifier.
func GenerateKVRequest ¶
func GenerateKVRequest(action shared.KVAction, kvs []*protos.KVObject, overwrite bool) *protos.KVRequest
GenerateKVRequest is used for converting from plain KVObjects to instructions. This func is used to simplify transforming KV HTTP requests -> KV broadcast requests.
func GenerateNodeID ¶
GenerateNodeID will generate a uuid node ID from the given install ID and node name This ensures that the node ID is deterministic and consistent across restarts since we have no local storage.
func GenerateUUID ¶
func GenerateUUID() string
func GenerateWasmMapping ¶
func GenerateWasmMapping(commands ...*protos.Command) map[string]*shared.WasmModule
GenerateWasmMapping will generate a map of WASM modules from the given command(s). NOTE: This is primarily useful for commands that have Steps which contain Wasm fields (like SetPipelines command). For commands that do not have Steps w/ Wasm, this will do nothing. This is used _specifically_ for the initial GetSetPipelinesByService() that SDKs call on startup (but if the SDK does not have any audiences, this will be empty).
func GetStepSubType ¶
func GetStepSubType(step *protos.PipelineStep) string
GetStepSubType transforms a protobuf enum into a string for use with telemetry This is used for detective, transform, and KV steps.
func GetStepType ¶
func GetStepType(step *protos.PipelineStep) string
GetStepType transforms a protobuf enum of a step type into a string for use with telemetry
func GetWasmIDFromRedisKey ¶ added in v0.0.41
func GetWasmNameFromKey ¶ added in v0.0.41
func GrpcMethodCounterName ¶
GrpcMethodCounterName turns a gRPC method name into a counter name for statsd This turns a string such as "/protos.External/GetSchema" into "grpc_method_external_get_schema_total"
func NowUnixTsNsUtcPtr ¶ added in v0.0.41
func NowUnixTsNsUtcPtr() *int64
func StandardResponse ¶
func StandardResponse(ctx context.Context, code protos.ResponseCode, msg string) *protos.StandardResponse
func StripWASMFields ¶
Types ¶
This section is empty.