api

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Bind: "localhost:8080",
}

DefaultConfig is the default configuration for the Config.

Functions

func PlayerToProto

func PlayerToProto(p proxy.Player) *pb.Player

func PlayersToProto

func PlayersToProto(p []proxy.Player) []*pb.Player

func ServerToProto

func ServerToProto(s proxy.RegisteredServer) *pb.Server

func ServersToProto

func ServersToProto(s []proxy.RegisteredServer) []*pb.Server

Types

type Config

type Config struct {
	// Bind is the address to bind the API server to.
	// Using a localhost address is recommended to avoid exposing the API to the public.
	Bind string `json:"bind,omitempty" yaml:"bind,omitempty"`
}

Config is the configuration for the Gate API.

func (Config) Validate

func (c Config) Validate() (warns []error, errs []error)

Validate validates the API configuration.

type Server

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

func NewServer

func NewServer(cfg Config, h Handler) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

type Service

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

func NewService

func NewService(p *proxy.Proxy) *Service

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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