rest

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.8.2

func New(
	versionSvc VersionService,
	serverSvc ServerService,
	tribeSvc TribeService,
	playerSvc PlayerService,
	villageSvc VillageService,
	ennoblementSvc EnnoblementService,
	playerSnapshotSvc PlayerSnapshotService,
	tribeSnapshotSvc TribeSnapshotService,
	tribeChangeSvc TribeChangeService,
	opts ...Option,
) *chi.Mux

Types

type CORSConfig

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

type EnnoblementService

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

type Option added in v0.8.2

type Option func(cfg *config)

func WithCORSConfig added in v0.8.2

func WithCORSConfig(cors CORSConfig) Option

func WithSwaggerConfig added in v0.8.2

func WithSwaggerConfig(swagger SwaggerConfig) Option

type PlayerService

type PlayerService interface {
	ListCountWithRelations(ctx context.Context, params domain.ListPlayersParams) ([]domain.PlayerWithRelations, int64, error)
	GetByServerKeyAndIDWithRelations(ctx context.Context, serverKey string, id int64) (domain.PlayerWithRelations, error)
}

type PlayerSnapshotService added in v0.7.0

type PlayerSnapshotService interface {
	ListCountWithRelations(ctx context.Context, params domain.ListPlayerSnapshotsParams) ([]domain.PlayerSnapshotWithRelations, int64, error)
}

type ServerService

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

type SwaggerConfig added in v0.2.2

type SwaggerConfig struct {
	Enabled bool
	Host    string
	Schemes []string
}

type TribeChangeService added in v0.7.5

type TribeChangeService interface {
	ListCountWithRelations(ctx context.Context, params domain.ListTribeChangesParams) ([]domain.TribeChangeWithRelations, int64, error)
}

type TribeService

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

type TribeSnapshotService added in v0.10.0

type TribeSnapshotService interface {
	ListCount(ctx context.Context, params domain.ListTribeSnapshotsParams) ([]domain.TribeSnapshot, int64, error)
}

type VersionService

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

type VillageService

type VillageService interface {
	ListCountWithRelations(ctx context.Context, params domain.ListVillagesParams) ([]domain.VillageWithRelations, int64, error)
	GetByServerKeyAndIDWithRelations(ctx context.Context, serverKey string, id int64) (domain.VillageWithRelations, error)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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