rest

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(cfg RouterConfig) *chi.Mux

Types

type CORSConfig

type CORSConfig struct {
	Enabled          bool
	AllowedOrigins   []string
	AllowedMethods   []string
	AllowCredentials bool
	MaxAge           int
}

type EnnoblementService

type EnnoblementService interface {
	List(ctx context.Context, params domain.ListEnnoblementsParams) ([]domain.Ennoblement, int64, error)
}

type PlayerService

type PlayerService interface {
	List(ctx context.Context, params domain.ListPlayersParams) ([]domain.Player, int64, error)
	GetByServerKeyAndID(ctx context.Context, serverKey string, id int64, includeTribe bool) (domain.Player, error)
}

type RouterConfig

type RouterConfig struct {
	VersionService     VersionService
	ServerService      ServerService
	TribeService       TribeService
	PlayerService      PlayerService
	VillageService     VillageService
	EnnoblementService EnnoblementService
	CORS               CORSConfig
	Swagger            bool
}

type ServerService

type ServerService interface {
	List(ctx context.Context, params domain.ListServersParams) ([]domain.Server, int64, error)
	GetNormalByVersionCodeAndKey(ctx context.Context, versionCode, key string) (domain.Server, error)
}

type TribeService

type TribeService interface {
	List(ctx context.Context, params domain.ListTribesParams) ([]domain.Tribe, int64, error)
	GetByServerKeyAndID(ctx context.Context, serverKey string, id int64) (domain.Tribe, error)
	GetByServerKeyAndTag(ctx context.Context, serverKey string, tag string) (domain.Tribe, error)
}

type VersionService

type VersionService interface {
	List(ctx context.Context, params domain.ListVersionsParams) ([]domain.Version, int64, error)
	GetByCode(ctx context.Context, code string) (domain.Version, error)
}

type VillageService

type VillageService interface {
	List(ctx context.Context, params domain.ListVillagesParams) ([]domain.Village, int64, error)
	GetByServerKeyAndID(ctx context.Context, serverKey string, id int64, includePlayer, includePlayerTribe bool) (domain.Village, error)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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