query

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueryType

func NewQueryType[Request any, Reply any](
	name string,
	handler func(wCtx engine.Context, req *Request) (*Reply, error),
	opts ...Option[Request, Reply],
) (engine.Query, error)

Types

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) GetQueryByName

func (m *Manager) GetQueryByName(name string) (engine.Query, error)

GetQueryByName returns a query corresponding to its name.

func (*Manager) GetRegisteredQueries

func (m *Manager) GetRegisteredQueries() []engine.Query

GetRegisteredQueries returns all the registered queries.

func (*Manager) RegisterQuery

func (m *Manager) RegisterQuery(name string, query engine.Query) error

RegisterQuery registers a query with the query manager. There can only be one query with a given name.

type Option

type Option[Request, Reply any] func(qt *queryType[Request, Reply])

func WithCustomQueryGroup

func WithCustomQueryGroup[Request, Reply any](group string) Option[Request, Reply]

WithCustomQueryGroup sets a custom group for the query. By default, queries are registered under the "game" group which maps it to the /query/game/:queryType route. This option allows you to set a custom group, which allow you to register the query under /query/<custom_group>/:queryType.

func WithQueryEVMSupport

func WithQueryEVMSupport[Request, Reply any]() Option[Request, Reply]

Jump to

Keyboard shortcuts

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