Documentation ¶
Overview ¶
Package traces defines types and interfaces for collecting and publishing GCI workflow traces.
Index ¶
- func GetCallText(ctx context.Context) string
- func GetClientName(ctx context.Context) string
- func GetComposedAt(ctx context.Context) time.Time
- func GetHandledAt(ctx context.Context) time.Time
- func GetParsedAt(ctx context.Context) time.Time
- func GetPlayerName(ctx context.Context) string
- func GetReceivedAt(ctx context.Context) time.Time
- func GetRecognizedAt(ctx context.Context) time.Time
- func GetRequest(ctx context.Context) any
- func GetRequestError(ctx context.Context) error
- func GetRequestText(ctx context.Context) string
- func GetSubmittedAt(ctx context.Context) time.Time
- func GetSynthesizedAt(ctx context.Context) time.Time
- func GetTraceID(ctx context.Context) string
- func NewRequestContext() context.Context
- func WithCallText(ctx context.Context, text string) context.Context
- func WithClientName(ctx context.Context, name string) context.Context
- func WithComposedAt(ctx context.Context, composedAt time.Time) context.Context
- func WithHandledAt(ctx context.Context, handledAt time.Time) context.Context
- func WithParsedAt(ctx context.Context, parsedAt time.Time) context.Context
- func WithPlayerName(ctx context.Context, name string) context.Context
- func WithReceivedAt(ctx context.Context, receivedAt time.Time) context.Context
- func WithRecognizedAt(ctx context.Context, recognizedAt time.Time) context.Context
- func WithRequest(ctx context.Context, request any) context.Context
- func WithRequestError(ctx context.Context, err error) context.Context
- func WithRequestText(ctx context.Context, text string) context.Context
- func WithSubmittedAt(ctx context.Context, submittedAt time.Time) context.Context
- func WithSynthesizedAt(ctx context.Context, synthesizedAt time.Time) context.Context
- func WithTraceID(ctx context.Context, traceID string) context.Context
- func WithoutRequestText(ctx context.Context) context.Context
- type DiscordWebhook
- type LogTracer
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCallText ¶
GetCallText returns the call text from the context, or an empty string if no call text is set.
func GetClientName ¶
GetClientName returns the client name from the context, or an empty string if no client name is set.
func GetComposedAt ¶
GetComposedAt returns the time the response was composed, or the zero time if no composed at time is set.
func GetHandledAt ¶
GetHandledAt returns the time the request was handled by the controller, or the zero time if no handled at time is set.
func GetParsedAt ¶
GetParsedAt returns the time the request was parsed, or the zero time if no parsed at time is set.
func GetPlayerName ¶ added in v0.9.0
GetPlayerName returns the player name from the context, or an empty string if no player name is set.
func GetReceivedAt ¶
GetReceivedAt returns the time the request was received, or the zero time if no received at time is set.
func GetRecognizedAt ¶
GetRecognizedAt returns the time the request was recognized, or the zero time if no recognized at time is set.
func GetRequest ¶
GetRequest returns the request from the context, or nil if no request is set.
func GetRequestError ¶
GetRequestError returns the error from the context, or nil if no error is set.
func GetRequestText ¶
GetRequestText returns the request text from the context, or an empty string if no request text is set.
func GetSubmittedAt ¶
GetSubmittedAt returns the time the response was submitted to the SRS client, or the zero time if no submitted at time is set.
func GetSynthesizedAt ¶
GetSynthesizedAt returns the time the response audio was synthesized, or the zero time if no synthesized at time is set.
func GetTraceID ¶
GetTraceID returns the trace ID from the context, or an empty string if no trace ID is set.
func NewRequestContext ¶
NewRequestContext returns a new context with a new trace ID.
func WithCallText ¶
WithCallText returns a new context with the given call text.
func WithClientName ¶
WithClientName returns a new context with the given client name.
func WithComposedAt ¶
WithComposedAt returns a new context with the given time the response was composed.
func WithHandledAt ¶
WithHandledAt returns a new context with the given time the request was handled by the controller.
func WithParsedAt ¶
WithParsedAt returns a new context with the given time the request was parsed.
func WithPlayerName ¶ added in v0.9.0
WithPlayerName returns a new context with the given player name.
func WithReceivedAt ¶
WithReceivedAt returns a new context with the given time the request was received.
func WithRecognizedAt ¶
WithRecognizedAt returns a new context with the given time the request was recognized.
func WithRequest ¶
WithRequest returns a new context with the given request.
func WithRequestError ¶
WithRequestError returns a new context with the given error.
func WithRequestText ¶
WithRequestText returns a new context with the given request text.
func WithSubmittedAt ¶
WithSubmittedAt returns a new context with the given time the response was submitted to the SRS client.
func WithSynthesizedAt ¶
WithSynthesizedAt returns a new context with the given time the response audio was synthesized.
func WithTraceID ¶
WithTraceID returns a new context with the given trace ID.
Types ¶
type DiscordWebhook ¶
type DiscordWebhook struct {
// contains filtered or unexported fields
}
DiscordWebhook publishes traces as Discord chat messages.
func NewDiscordWebhook ¶
func NewDiscordWebhook(webhookID, token string) (*DiscordWebhook, error)
NewDiscordWebhook creates a new DiscordWebhook which sends messages to the given webhook.
func (*DiscordWebhook) Trace ¶
func (w *DiscordWebhook) Trace(ctx context.Context)
Trace sends any trace information in the context to the Discord webhook.