metrics

package
v0.0.0-...-0b5a896 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: ISC Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(next http.Handler, client *Client) http.Handler

func Record

func Record(ctx context.Context, category, action, game, peerID, lobbyID string, data ...string)

func RecordEvent

func RecordEvent(ctx context.Context, params EventParams)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string) *Client

func (*Client) Record

func (c *Client) Record(ctx context.Context, category, action, game, peerID, lobbyID string, data ...string)

func (*Client) RecordEvent

func (c *Client) RecordEvent(ctx context.Context, params EventParams)

type Event

type Event struct {
	Time    int64  `json:"time"`
	Client  string `json:"client"`
	Game    string `json:"game"`
	Version string `json:"version"`

	Category string `json:"category"`
	Action   string `json:"action"`

	Peer  string `json:"peer"`
	Lobby string `json:"lobby,omitempty"`

	Data map[string]string `json:"data,omitempty"`
}

type EventParams

type EventParams struct {
	Game     string `json:"game"`
	Category string `json:"category"`
	Action   string `json:"action"`
	PeerID   string `json:"peer"`
	LobbyID  string `json:"lobby,omitempty"`

	Data map[string]string `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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