biz

package
v0.0.0-...-771d5d4 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	Id        int64     `json:"id"`
	Name      string    `json:"name"`
	Password  string    `json:"password"`
	CreatedAt time.Time `json:"created_at"`
}

type AdminClaims

type AdminClaims struct {
	Id int64
	jwt.RegisteredClaims
}

func (*AdminClaims) GetAudience

func (a *AdminClaims) GetAudience() (jwt.ClaimStrings, error)

func (*AdminClaims) GetExpirationTime

func (a *AdminClaims) GetExpirationTime() (*jwt.NumericDate, error)

func (*AdminClaims) GetIssuedAt

func (a *AdminClaims) GetIssuedAt() (*jwt.NumericDate, error)

func (*AdminClaims) GetIssuer

func (a *AdminClaims) GetIssuer() (string, error)

func (*AdminClaims) GetNotBefore

func (a *AdminClaims) GetNotBefore() (*jwt.NumericDate, error)

func (*AdminClaims) GetSubject

func (a *AdminClaims) GetSubject() (string, error)

type AdminRepo

type AdminRepo interface {
	GetAdmin(ctx context.Context, id int64) (*Admin, error)
	GetAdminByName(ctx context.Context, username string) (*Admin, error)
	CreateAdmin(ctx context.Context, admin *Admin) error
}

type AdminUseCase

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

func NewAdminUseCase

func NewAdminUseCase(repo AdminRepo, ac *conf.Auth, logger log.Logger) *AdminUseCase

func (*AdminUseCase) CreateAdmin

func (u *AdminUseCase) CreateAdmin(ctx context.Context, admin *Admin) error

func (*AdminUseCase) GetAdmin

func (u *AdminUseCase) GetAdmin(ctx context.Context, id int64) (*Admin, error)

func (*AdminUseCase) Login

func (u *AdminUseCase) Login(ctx context.Context, name string, password string) (string, error)

type GameFileRepo

type GameFileRepo interface {
	UploadGame(ctx context.Context, name string, data []byte) error
	ListGames(ctx context.Context, page, pageSize int32) ([]*v1.GameFileMetadata, int32, error)
	DeleteGames(ctx context.Context, games []string) (int32, error)
}

type GameFileUseCase

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

func NewGameFileUseCase

func NewGameFileUseCase(repo GameFileRepo, logger log.Logger) *GameFileUseCase

func (*GameFileUseCase) DeleteGames

func (uc *GameFileUseCase) DeleteGames(ctx context.Context, games []string) (int32, error)

func (*GameFileUseCase) ListGames

func (uc *GameFileUseCase) ListGames(ctx context.Context, page, pageSize int32) ([]*v1.GameFileMetadata, int32, error)

func (*GameFileUseCase) UploadGame

func (uc *GameFileUseCase) UploadGame(ctx context.Context, name string, data []byte) error

type GamingRepo

type GamingRepo interface {
	GetRoomGameStats(ctx context.Context, roomId int64, endpoint string) (*RoomGameStats, error)
	ListGamingServiceEndpoints(ctx context.Context, page, pageSize int32) ([]*ServiceEndpoint, int32, error)
	ListActiveRoomsOnEndpoint(ctx context.Context, id string) ([]*RoomStats, error)
}

type GamingUseCase

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

func NewGamingUseCase

func NewGamingUseCase(repo GamingRepo, rr RoomRepo, ur UserRepo, logger log.Logger) *GamingUseCase

func (*GamingUseCase) ListActiveRoomsOnEndpoint

func (g *GamingUseCase) ListActiveRoomsOnEndpoint(ctx context.Context, id string) ([]*RoomStats, error)

func (*GamingUseCase) ListGamingServiceEndpoints

func (g *GamingUseCase) ListGamingServiceEndpoints(ctx context.Context, page, pageSize int32) ([]*ServiceEndpoint, int32, error)

type Room

type Room struct {
	Id          int64  `json:"id"`
	Name        string `json:"name"`
	Host        int64  `json:"host"`
	HostName    string `json:"hostName"`
	Private     bool   `json:"private"`
	MemberCount int32  `json:"memberCount"`
	MemberLimit int32  `json:"memberLimit"`
	Endpoint    string `json:"endpoint"`
}

type RoomGameStats

type RoomGameStats struct {
	Connections       int32  `json:"connections"`
	ActiveConnections int32  `json:"activeConnections"`
	Game              string `json:"game"`
	Uptime            int64  `json:"uptime"`
}

type RoomRepo

type RoomRepo interface {
	ListRooms(ctx context.Context, page int32, pageSize int32) ([]*Room, int32, error)
	GetRoom(ctx context.Context, id int64) (*Room, error)
	GetRoomEndpoint(ctx context.Context, id int64) (string, error)
}

type RoomStats

type RoomStats struct {
	Room
	RoomGameStats
}

type RoomUseCase

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

func NewRoomUseCase

func NewRoomUseCase(repo RoomRepo, ur UserRepo, gr GamingRepo, logger log.Logger) *RoomUseCase

func (*RoomUseCase) GetRoomStats

func (uc *RoomUseCase) GetRoomStats(ctx context.Context, roomId int64) (*RoomStats, error)

func (*RoomUseCase) ListRooms

func (uc *RoomUseCase) ListRooms(ctx context.Context, page int32, pageSize int32) ([]*Room, int32, error)

type ServiceEndpoint

type ServiceEndpoint struct {
	Address       string `json:"address"`
	Id            string `json:"id"`
	EmulatorCount int32  `json:"emulatorCount"`
	CpuUsage      int32  `json:"cpuUsage"`
	MemoryUsed    int64  `json:"memoryUsed"`
	MemoryTotal   int64  `json:"memoryTotal"`
	Uptime        int64  `json:"uptime"`
}

type User

type User struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type UserRepo

type UserRepo interface {
	GetUser(ctx context.Context, id int64) (*User, error)
}

Jump to

Keyboard shortcuts

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