potato

package
v0.0.0-...-de8f578 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCollection

func DeleteCollection(ctx context.Context, client *firestore.Client,
	ref *firestore.CollectionRef, batchSize int) error

DeleteCollection deletes entire data stored in specified ref

func EncodeJSONResponse

func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error

EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code

func InsertCollection

func InsertCollection(ctx context.Context, firestore *firestore.Client, collectionName string) error

InsertCollection inserts entire data of json migration file to specified ref

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger injects request logging to router(http.Handler)

func NewRouter

func NewRouter(routers ...Router) *mux.Router

NewRouter creates a new router for any number of api routers

func ReGenerateDatabase

func ReGenerateDatabase(firestore *firestore.Client) error

ReGenerateDatabase drop and insert data to firestore

func ReadFormFileToTempFile

func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)

ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file

func ReadFormFilesToTempFiles

func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)

ReadFormFilesToTempFiles reads files array data from a request form and writes it to a temporary files

Types

type Background

type Background struct {

	// english and number only name for searching
	Name string `json:"name,omitempty" validate:"alphanum,min=1,max=50"`

	// Reserved for future update. current default is 1.
	Version int32 `json:"version,omitempty" validate:"gte=1,lte=1"`

	// base title of this content
	Title string `json:"title,omitempty" validate:"min=1,max=100"`

	// something footer(ex. featuring xyz) for this content
	Subtitle string `json:"subtitle,omitempty" validate:"min=1,max=100"`

	// author of this content
	Author string `json:"author,omitempty" validate:"alphanumunicode,min=1,max=50"`

	Thumbnail SonolusResourceLocator `json:"thumbnail,omitempty" validate:"omitempty"`

	Data SonolusResourceLocator `json:"data,omitempty" validate:"omitempty"`

	Image SonolusResourceLocator `json:"image,omitempty" validate:"omitempty"`

	// 独自要素: データを作成したエポックミリ秒(ソート用)
	CreatedTime int32 `json:"createdTime,omitempty" validate:"gte=1"`

	// 独自要素: データを更新したエポックミリ秒(ソート用)
	UpdatedTime int32 `json:"updatedTime,omitempty" validate:"gte=1"`

	// 独自要素: 譜面作成者のユーザーID
	UserID string `json:"userId,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// 独自要素: サイト内および譜面情報欄に表示される説明文
	Description string `json:"description,omitempty" validate:"min=1,max=3000"`
}

Background - A background provides background graphical element to levels / It defines background used for specific level https://github.com/NonSpicyBurrito/sonolus-wiki/wiki/Background

type BackgroundsAPIController

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

A BackgroundsAPIController binds http requests to an api service and writes the service results to the http response

func (*BackgroundsAPIController) AddBackground

func (c *BackgroundsAPIController) AddBackground(w http.ResponseWriter, r *http.Request)

AddBackground - Add background

func (*BackgroundsAPIController) EditBackground

func (c *BackgroundsAPIController) EditBackground(w http.ResponseWriter, r *http.Request)

EditBackground - Edit background

func (*BackgroundsAPIController) GetBackground

func (c *BackgroundsAPIController) GetBackground(w http.ResponseWriter, r *http.Request)

GetBackground - Get background

func (*BackgroundsAPIController) GetBackgroundList

func (c *BackgroundsAPIController) GetBackgroundList(w http.ResponseWriter, r *http.Request)

GetBackgroundList - Get background list

func (*BackgroundsAPIController) Routes

func (c *BackgroundsAPIController) Routes() Routes

Routes returns all of the api route for the BackgroundsAPIController

type BackgroundsAPIRouter

type BackgroundsAPIRouter interface {
	AddBackground(http.ResponseWriter, *http.Request)
	EditBackground(http.ResponseWriter, *http.Request)
	GetBackground(http.ResponseWriter, *http.Request)
	GetBackgroundList(http.ResponseWriter, *http.Request)
}

BackgroundsAPIRouter defines the required methods for binding the api requests to a responses for the BackgroundsAPI The BackgroundsAPIRouter implementation should parse necessary information from the http request, pass the data to a BackgroundsAPIServicer to perform the required actions, then write the service results to the http response.

type BackgroundsAPIService

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

BackgroundsAPIService is a service that implents the logic for the BackgroundsAPIServicer This service should implement the business logic for every endpoint for the BackgroundsAPI API. Include any external packages or services that will be required by this service.

func (*BackgroundsAPIService) AddBackground

func (s *BackgroundsAPIService) AddBackground(ctx context.Context, backgroundName string, background Background) (ImplResponse, error)

AddBackground - Add background

func (*BackgroundsAPIService) EditBackground

func (s *BackgroundsAPIService) EditBackground(ctx context.Context, backgroundName string, background Background) (ImplResponse, error)

EditBackground - Edit background

func (*BackgroundsAPIService) GetBackground

func (s *BackgroundsAPIService) GetBackground(ctx context.Context, backgroundName string) (ImplResponse, error)

GetBackground - Get background

func (*BackgroundsAPIService) GetBackgroundList

func (s *BackgroundsAPIService) GetBackgroundList(ctx context.Context, localization string, page int32, keywords string) (ImplResponse, error)

GetBackgroundList - Get background list

type BackgroundsAPIServicer

type BackgroundsAPIServicer interface {
	AddBackground(context.Context, string, Background) (ImplResponse, error)
	EditBackground(context.Context, string, Background) (ImplResponse, error)
	GetBackground(context.Context, string) (ImplResponse, error)
	GetBackgroundList(context.Context, string, int32, string) (ImplResponse, error)
}

BackgroundsAPIServicer defines the api actions for the BackgroundsAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewBackgroundsAPIService

func NewBackgroundsAPIService(firestore *firestore.Client, cache *CacheService) BackgroundsAPIServicer

NewBackgroundsAPIService creates a default api service

type ByCreatedTime

type ByCreatedTime struct{ DataList }

ByCreatedTime is decorator of DataList for sorting by created time

func (ByCreatedTime) Less

func (b ByCreatedTime) Less(i, j int) bool

Less is compare method for sorting by created time

type ByDifficulty

type ByDifficulty struct{ DataList }

ByDifficulty is compare method for sorting by difficulty

func (ByDifficulty) Less

func (b ByDifficulty) Less(i, j int) bool

Less is compare method for sorting by difficulty

type ByName

type ByName struct{ DataList }

ByName is decorator of DataList for sorting by name

func (ByName) Less

func (b ByName) Less(i, j int) bool

Less is compare method for sorting by name

type ByNotes

type ByNotes struct{ DataList }

ByNotes is compare method for sorting by notes

func (ByNotes) Less

func (b ByNotes) Less(i, j int) bool

Less is compare method for sorting by notes

type ByUpdatedTime

type ByUpdatedTime struct{ DataList }

ByUpdatedTime is decorator of DataList for sorting by updated time

func (ByUpdatedTime) Less

func (b ByUpdatedTime) Less(i, j int) bool

Less is compare method for sorting by updated time

type Cache

type Cache struct {
	Data map[string]interface{}
}

Cache is data store struct for storeing data

func (*Cache) Add

func (c *Cache) Add(key string, value interface{}) error

Add adds the value to cache with using specified key. It returns error if key already exists.

func (*Cache) Get

func (c *Cache) Get(key string) (interface{}, error)

Get gets value from cache with using specified key. It returns error if key does not exist in cache.

func (*Cache) GetPage

func (c *Cache) GetPage(pageID int32, searchQuery request.SearchQuery) ([]byte, error)

GetPage gets specified page from cache datalist. 20 contents will be returned as json bytes array if succeed. It returns error if it couldn't marshal to json bytes array.

func (*Cache) IsExist

func (c *Cache) IsExist(key string) bool

IsExist check the specified key is exists in cache

func (*Cache) IsOwnerMatch

func (c *Cache) IsOwnerMatch(key string, userID string) (bool, error)

IsOwnerMatch check the owner of specified content is same as specified userID. It returns error if specified key was not existed.

func (*Cache) Pages

func (c *Cache) Pages() int32

Pages returns the length of cache divided by 20 and also roundup proceeded

func (*Cache) Remove

func (c *Cache) Remove(key string, data interface{}) error

Remove removes data from cache that has specified key.

func (*Cache) Set

func (c *Cache) Set(key string, value interface{})

Set sets the value to cache with using specified key

type CacheInitService

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

CacheInitService is service for getting data from firestore

func NewCacheInitService

func NewCacheInitService(firestore *firestore.Client) *CacheInitService

NewCacheInitService creates a new instance for getting data from firestore

func (*CacheInitService) LoadDatabaseFromFirebase

func (s *CacheInitService) LoadDatabaseFromFirebase(colName string) (map[string]interface{}, error)

LoadDatabaseFromFirebase gets the entire database from Firebase

type CacheService

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

CacheService stores firestore data and provides add and remove methods to handle get request

func NewCacheService

func NewCacheService(firestore *firestore.Client) *CacheService

NewCacheService creates a instance for stores firestore data

func (*CacheService) Add

func (s *CacheService) Add(name string, data interface{}) error

Add adds specified data to cache with using specified name as key. Data type must be background, effect, engine, level, particle, or skin.

func (*CacheService) GetUserIDFromTest

func (s *CacheService) GetUserIDFromTest(testID string) (string, error)

GetUserIDFromTest gets the userID from the testID It returns the error if the testID wasn't valid

func (*CacheService) InitCache

func (s *CacheService) InitCache() error

InitCache initialize caches by getting whole firestore data (this method should only called once when start server)

func (*CacheService) InitNews

func (s *CacheService) InitNews()

InitNews add news to cache instance (using static value for now)

func (*CacheService) Set

func (s *CacheService) Set(name string, data interface{}) error

Set sets specified data to cache with using specified name as key. Data type must be background, effect, engine, level, particle, or skin.

type DataList

type DataList []interface{}

DataList object is a list of something data

func (DataList) Len

func (l DataList) Len() int

Len implements length function for using sort

func (DataList) Swap

func (l DataList) Swap(i, j int)

Swap implements swap function for using sort

type Effect

type Effect struct {

	// english and number only name for searching
	Name string `json:"name,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// Reserved for future update. current default is 1.
	Version int32 `json:"version,omitempty" validate:"omitempty,gte=1,lte=1"`

	// base title of this content
	Title string `json:"title,omitempty" validate:"omitempty,min=1,max=100"`

	// something footer(ex. featuring xyz) for this content
	Subtitle string `json:"subtitle,omitempty" validate:"omitempty,min=1,max=100"`

	// author of this content
	Author string `json:"author,omitempty" validate:"omitempty,alphanumunicode,min=1,max=50"`

	Thumbnail SonolusResourceLocator `json:"thumbnail,omitempty" validate:"omitempty"`

	Data SonolusResourceLocator `json:"data,omitempty" validate:"omitempty"`

	// 独自要素: データを作成したエポックミリ秒(ソート用)
	CreatedTime int32 `json:"createdTime,omitempty" validate:"omitempty,gte=1"`

	// 独自要素: データを更新したエポックミリ秒(ソート用)
	UpdatedTime int32 `json:"updatedTime,omitempty" validate:"omitempty,gte=1"`

	// 独自要素: 譜面作成者のユーザーID
	UserID string `json:"userId,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// 独自要素: サイト内および譜面情報欄に表示される説明文
	Description string `json:"description,omitempty" validate:"omitempty,min=1,max=3000"`
}

Effect - An effect provides audio elements to levels / It defines audio effect used for specific level https://github.com/NonSpicyBurrito/sonolus-wiki/wiki/Effect

type EffectsAPIController

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

A EffectsAPIController binds http requests to an api service and writes the service results to the http response

func (*EffectsAPIController) AddEffect

func (c *EffectsAPIController) AddEffect(w http.ResponseWriter, r *http.Request)

AddEffect - Add effect

func (*EffectsAPIController) EditEffect

func (c *EffectsAPIController) EditEffect(w http.ResponseWriter, r *http.Request)

EditEffect - Edit effect

func (*EffectsAPIController) GetEffect

func (c *EffectsAPIController) GetEffect(w http.ResponseWriter, r *http.Request)

GetEffect - Get effect

func (*EffectsAPIController) GetEffectList

func (c *EffectsAPIController) GetEffectList(w http.ResponseWriter, r *http.Request)

GetEffectList - Get effect list

func (*EffectsAPIController) Routes

func (c *EffectsAPIController) Routes() Routes

Routes returns all of the api route for the EffectsAPIController

type EffectsAPIRouter

type EffectsAPIRouter interface {
	AddEffect(http.ResponseWriter, *http.Request)
	EditEffect(http.ResponseWriter, *http.Request)
	GetEffect(http.ResponseWriter, *http.Request)
	GetEffectList(http.ResponseWriter, *http.Request)
}

EffectsAPIRouter defines the required methods for binding the api requests to a responses for the EffectsAPI The EffectsAPIRouter implementation should parse necessary information from the http request, pass the data to a EffectsAPIServicer to perform the required actions, then write the service results to the http response.

type EffectsAPIService

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

EffectsAPIService is a service that implents the logic for the EffectsAPIServicer This service should implement the business logic for every endpoint for the EffectsAPI API. Include any external packages or services that will be required by this service.

func (*EffectsAPIService) AddEffect

func (s *EffectsAPIService) AddEffect(ctx context.Context, effectName string, effect Effect) (ImplResponse, error)

AddEffect - Add effect

func (*EffectsAPIService) EditEffect

func (s *EffectsAPIService) EditEffect(ctx context.Context, effectName string, effect Effect) (ImplResponse, error)

EditEffect - Edit effect

func (*EffectsAPIService) GetEffect

func (s *EffectsAPIService) GetEffect(ctx context.Context, effectName string) (ImplResponse, error)

GetEffect - Get effect

func (*EffectsAPIService) GetEffectList

func (s *EffectsAPIService) GetEffectList(ctx context.Context, localization string, page int32, keywords string) (ImplResponse, error)

GetEffectList - Get effect list

type EffectsAPIServicer

type EffectsAPIServicer interface {
	AddEffect(context.Context, string, Effect) (ImplResponse, error)
	EditEffect(context.Context, string, Effect) (ImplResponse, error)
	GetEffect(context.Context, string) (ImplResponse, error)
	GetEffectList(context.Context, string, int32, string) (ImplResponse, error)
}

EffectsAPIServicer defines the api actions for the EffectsAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewEffectsAPIService

func NewEffectsAPIService(firestore *firestore.Client, cache *CacheService) EffectsAPIServicer

NewEffectsAPIService creates a default api service

type Engine

type Engine struct {

	// english and number only name for searching
	Name string `json:"name,omitempty" validate:"alphanum,min=1,max=50"`

	// Reserved for future update. current default is 1.
	Version int32 `json:"version,omitempty" validate:"gte=1,lte=1"`

	// base title of this content
	Title string `json:"title,omitempty" validate:"min=1,max=100"`

	// something footer(ex. featuring xyz) for this content
	Subtitle string `json:"subtitle,omitempty" validate:"omitempty,min=1,max=100"`

	// author of this content
	Author string `json:"author,omitempty" validate:"omitempty,min=1,max=50"`

	Thumbnail SonolusResourceLocator `json:"thumbnail,omitempty" validate:"omitempty"`

	Data SonolusResourceLocator `json:"data,omitempty" validate:"omitempty"`

	Configuration SonolusResourceLocator `json:"configuration,omitempty" validate:"omitempty"`

	Skin Skin `json:"skin,omitempty" validate:"omitempty"`

	Background Background `json:"background,omitempty" validate:"omitempty"`

	Effect Effect `json:"effect,omitempty" validate:"omitempty"`

	Particle Particle `json:"particle,omitempty" validate:"omitempty"`

	// 独自要素: データを作成したエポックミリ秒(ソート用)
	CreatedTime int32 `json:"createdTime,omitempty" validate:"omitempty,gte=1"`

	// 独自要素: データを更新したエポックミリ秒(ソート用)
	UpdatedTime int32 `json:"updatedTime,omitempty" validate:"omitempty,gte=1"`

	// 独自要素: 譜面作成者のユーザーID
	UserID string `json:"userId,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// 独自要素: サイト内および譜面情報欄に表示される説明文
	Description string `json:"description,omitempty" validate:"omitempty,min=1,max=3000"`
}

Engine - An engine provides scripted behaviors to levels / It defines shared game engine for playing https://github.com/NonSpicyBurrito/sonolus-wiki/wiki/Engine

type EnginesAPIController

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

A EnginesAPIController binds http requests to an api service and writes the service results to the http response

func (*EnginesAPIController) AddEngine

func (c *EnginesAPIController) AddEngine(w http.ResponseWriter, r *http.Request)

AddEngine - Add engine

func (*EnginesAPIController) EditEngine

func (c *EnginesAPIController) EditEngine(w http.ResponseWriter, r *http.Request)

EditEngine - Edit engine

func (*EnginesAPIController) GetEngine

func (c *EnginesAPIController) GetEngine(w http.ResponseWriter, r *http.Request)

GetEngine - Get engine

func (*EnginesAPIController) GetEngineList

func (c *EnginesAPIController) GetEngineList(w http.ResponseWriter, r *http.Request)

GetEngineList - Get engine list

func (*EnginesAPIController) Routes

func (c *EnginesAPIController) Routes() Routes

Routes returns all of the api route for the EnginesAPIController

type EnginesAPIRouter

type EnginesAPIRouter interface {
	AddEngine(http.ResponseWriter, *http.Request)
	EditEngine(http.ResponseWriter, *http.Request)
	GetEngine(http.ResponseWriter, *http.Request)
	GetEngineList(http.ResponseWriter, *http.Request)
}

EnginesAPIRouter defines the required methods for binding the api requests to a responses for the EnginesAPI The EnginesAPIRouter implementation should parse necessary information from the http request, pass the data to a EnginesAPIServicer to perform the required actions, then write the service results to the http response.

type EnginesAPIService

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

EnginesAPIService is a service that implents the logic for the EnginesAPIServicer This service should implement the business logic for every endpoint for the EnginesAPI API. Include any external packages or services that will be required by this service.

func (*EnginesAPIService) AddEngine

func (s *EnginesAPIService) AddEngine(ctx context.Context, engineName string, engine Engine) (ImplResponse, error)

AddEngine - Add engine

func (*EnginesAPIService) EditEngine

func (s *EnginesAPIService) EditEngine(ctx context.Context, engineName string, engine Engine) (ImplResponse, error)

EditEngine - Edit engine

func (*EnginesAPIService) GetEngine

func (s *EnginesAPIService) GetEngine(ctx context.Context, engineName string) (ImplResponse, error)

GetEngine - Get engine

func (*EnginesAPIService) GetEngineList

func (s *EnginesAPIService) GetEngineList(ctx context.Context, localization string, page int32, keywords string) (ImplResponse, error)

GetEngineList - Get engine list

type EnginesAPIServicer

type EnginesAPIServicer interface {
	AddEngine(context.Context, string, Engine) (ImplResponse, error)
	EditEngine(context.Context, string, Engine) (ImplResponse, error)
	GetEngine(context.Context, string) (ImplResponse, error)
	GetEngineList(context.Context, string, int32, string) (ImplResponse, error)
}

EnginesAPIServicer defines the api actions for the EnginesAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewEnginesAPIService

func NewEnginesAPIService(firestore *firestore.Client, cache *CacheService) EnginesAPIServicer

NewEnginesAPIService creates a default api service

type GetBackgroundListResponse

type GetBackgroundListResponse struct {

	// used for pagination, default is 1
	PageCount int32 `json:"pageCount"`

	Items []Background `json:"items"`
}

GetBackgroundListResponse - Response struct of getBackgroundList

type GetBackgroundResponse

type GetBackgroundResponse struct {
	Item Background `json:"item"`

	Description string `json:"description"`

	Recommended []Background `json:"recommended"`
}

GetBackgroundResponse - Response struct of getBackground

type GetEffectListResponse

type GetEffectListResponse struct {

	// used for pagination, default is 1
	PageCount int32 `json:"pageCount"`

	Items []Effect `json:"items"`
}

GetEffectListResponse - Response struct of getEffectList

type GetEffectResponse

type GetEffectResponse struct {
	Item Effect `json:"item"`

	Description string `json:"description"`

	Recommended []Effect `json:"recommended"`
}

GetEffectResponse - Response struct of getEffect

type GetEngineListResponse

type GetEngineListResponse struct {

	// used for pagination, default is 1
	PageCount int32 `json:"pageCount"`

	Items []Engine `json:"items"`
}

GetEngineListResponse - Response struct of getEngineList

type GetEngineResponse

type GetEngineResponse struct {
	Item Engine `json:"item"`

	Description string `json:"description"`

	Recommended []Engine `json:"recommended"`
}

GetEngineResponse - Response struct of getEngine

type GetLevelListResponse

type GetLevelListResponse struct {

	// used for pagination, default is 1
	PageCount int32 `json:"pageCount"`

	Items []Level `json:"items"`
}

GetLevelListResponse - Response struct of getLevelList

type GetLevelResponse

type GetLevelResponse struct {
	Item Level `json:"item"`

	Description string `json:"description"`

	Recommended []Level `json:"recommended"`
}

GetLevelResponse - Response struct of getLevel

type GetParticleListResponse

type GetParticleListResponse struct {

	// used for pagination, default is 1
	PageCount int32 `json:"pageCount"`

	Items []Particle `json:"items"`
}

GetParticleListResponse - Response struct of getParticleList

type GetParticleResponse

type GetParticleResponse struct {
	Item Particle `json:"item"`

	Description string `json:"description"`

	Recommended []Particle `json:"recommended"`
}

GetParticleResponse - Response struct of getParticle

type GetSkinListResponse

type GetSkinListResponse struct {

	// used for pagination, default is 1
	PageCount int32 `json:"pageCount"`

	Items []Skin `json:"items"`
}

GetSkinListResponse - Response struct of getSkinList

type GetSkinResponse

type GetSkinResponse struct {
	Item Skin `json:"item"`

	Description string `json:"description"`

	Recommended []Skin `json:"recommended"`
}

GetSkinResponse - Response struct of getSkin

type GetUserListResponse

type GetUserListResponse struct {

	// サーバーに登録されたユーザー一覧
	Users []User `json:"users"`

	// 合計アカウント数
	Total int32 `json:"total"`

	// 合計ページ数
	Pages int32 `json:"pages"`
}

GetUserListResponse - Structure of getList response

type ImplResponse

type ImplResponse struct {
	Code int
	Body interface{}
}

ImplResponse defines an error code with the associated body

func Response

func Response(code int, body interface{}) ImplResponse

Response return a ImplResponse struct filled

type InfoAPIController

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

A InfoAPIController binds http requests to an api service and writes the service results to the http response

func (*InfoAPIController) EditInfo

func (c *InfoAPIController) EditInfo(w http.ResponseWriter, r *http.Request)

EditInfo - Edit server info

func (*InfoAPIController) GetServerInfo

func (c *InfoAPIController) GetServerInfo(w http.ResponseWriter, r *http.Request)

GetServerInfo - Get server info

func (*InfoAPIController) Routes

func (c *InfoAPIController) Routes() Routes

Routes returns all of the api route for the InfoAPIController

type InfoAPIRouter

type InfoAPIRouter interface {
	EditInfo(http.ResponseWriter, *http.Request)
	GetServerInfo(http.ResponseWriter, *http.Request)
}

InfoAPIRouter defines the required methods for binding the api requests to a responses for the InfoAPI The InfoAPIRouter implementation should parse necessary information from the http request, pass the data to a InfoAPIServicer to perform the required actions, then write the service results to the http response.

type InfoAPIService

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

InfoAPIService is a service that implents the logic for the InfoAPIServicer This service should implement the business logic for every endpoint for the InfoAPI API. Include any external packages or services that will be required by this service.

func (*InfoAPIService) EditInfo

func (s *InfoAPIService) EditInfo(ctx context.Context, serverInfo ServerInfo) (ImplResponse, error)

EditInfo - Edit server info

func (*InfoAPIService) GetServerInfo

func (s *InfoAPIService) GetServerInfo(ctx context.Context) (ImplResponse, error)

GetServerInfo - Get server info

type InfoAPIServicer

type InfoAPIServicer interface {
	EditInfo(context.Context, ServerInfo) (ImplResponse, error)
	GetServerInfo(context.Context) (ImplResponse, error)
}

InfoAPIServicer defines the api actions for the InfoAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewInfoAPIService

func NewInfoAPIService(firestore *firestore.Client, cache *CacheService) InfoAPIServicer

NewInfoAPIService creates a default api service

type Level

type Level struct {

	// english and number only name for searching
	Name string `json:"name,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// Reserved for future update. current default is 1.
	Version int32 `json:"version,omitempty" validate:"omitempty,gte=1,lte=1"`

	// Difficulty of the level
	Rating int32 `json:"rating,omitempty" validate:"omitempty,gte=1,lte=1000"`

	Engine Engine `json:"engine,omitempty" validate:"omitempty"`

	UseSkin LevelUseSkin `json:"useSkin,omitempty" validate:"omitempty"`

	UseBackground LevelUseBackground `json:"useBackground,omitempty" validate:"omitempty"`

	UseEffect LevelUseEffect `json:"useEffect,omitempty" validate:"omitempty"`

	UseParticle LevelUseParticle `json:"useParticle,omitempty" validate:"omitempty"`

	// base title of this content
	Title string `json:"title,omitempty" validate:"omitempty,min=1,max=100"`

	// artist names of original music
	Artists string `json:"artists,omitempty" validate:"omitempty,min=1,max=100"`

	// author of this content
	Author string `json:"author,omitempty" validate:"omitempty,min=1,max=50"`

	Cover SonolusResourceLocator `json:"cover,omitempty" validate:"omitempty"`

	Bgm SonolusResourceLocator `json:"bgm,omitempty" validate:"omitempty"`

	Data SonolusResourceLocator `json:"data,omitempty" validate:"omitempty"`

	// 独自要素: 楽曲のジャンル
	Genre string `json:"genre,omitempty"`

	// 独自要素: 楽曲が全体公開かどうか
	Public bool `json:"public,omitempty"`

	// 独自要素: 譜面作成者のユーザーID
	UserID string `json:"userId,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// 独自要素: 譜面内のノーツ数
	Notes int32 `json:"notes,omitempty" validate:"gte=1,lte=10000000"`

	// 独自要素: データを作成したエポックミリ秒(ソート用)
	CreatedTime int32 `json:"createdTime,omitempty" validate:"gte=1"`

	// 独自要素: データを更新したエポックミリ秒(ソート用)
	UpdatedTime int32 `json:"updatedTime,omitempty" validate:"gte=1"`

	// 独自要素: サイト内および譜面情報欄に表示される説明文
	Description string `json:"description,omitempty" validate:"min=1,max=3000"`
}

Level - A level provides a list of entities and powered by scripted behavior in engine, with skin, effect, background and particle, to create gameplay experience for players / It defines level for actual user play. It includes all data to play one level. https://github.com/NonSpicyBurrito/sonolus-wiki/wiki/Level

type LevelUseBackground

type LevelUseBackground struct {

	// If true (recommended), default resource specified by the engine will be used.
	UseDefault bool `json:"useDefault"`

	Item *Background `json:"item,omitempty" validate:"omitempty"`
}

LevelUseBackground - struct to define what background does the level uses. Item can be empty if UseDefault is true.

type LevelUseEffect

type LevelUseEffect struct {

	// If true (recommended), default resource specified by the engine will be used.
	UseDefault bool `json:"useDefault"`

	Item *Effect `json:"item,omitempty" validate:"omitempty"`
}

LevelUseEffect - struct to define what effect does the level uses. Item can be empty if UseDefault is true.

type LevelUseParticle

type LevelUseParticle struct {

	// If true (recommended), default resource specified by the engine will be used.
	UseDefault bool `json:"useDefault"`

	Item *Particle `json:"item,omitempty" validate:"omitempty"`
}

LevelUseParticle - struct to define what particle does the level uses. Item can be empty if UseDefault is true.

type LevelUseSkin

type LevelUseSkin struct {

	// If true (recommended), default resource specified by the engine will be used.
	UseDefault bool `json:"useDefault"`

	Item *Skin `json:"item,omitempty" validate:"omitempty"`
}

LevelUseSkin - struct to define what skin does the level uses. Item can be empty if UseDefault is true.

type LevelsAPIController

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

A LevelsAPIController binds http requests to an api service and writes the service results to the http response

func (*LevelsAPIController) AddLevel

func (c *LevelsAPIController) AddLevel(w http.ResponseWriter, r *http.Request)

AddLevel - Add level

func (*LevelsAPIController) EditLevel

func (c *LevelsAPIController) EditLevel(w http.ResponseWriter, r *http.Request)

EditLevel - Edit level

func (*LevelsAPIController) GetLevel

func (c *LevelsAPIController) GetLevel(w http.ResponseWriter, r *http.Request)

GetLevel - Get level

func (*LevelsAPIController) GetLevelList

func (c *LevelsAPIController) GetLevelList(w http.ResponseWriter, r *http.Request)

GetLevelList - Get level list

func (*LevelsAPIController) Routes

func (c *LevelsAPIController) Routes() Routes

Routes returns all of the api route for the LevelsAPIController

type LevelsAPIRouter

type LevelsAPIRouter interface {
	AddLevel(http.ResponseWriter, *http.Request)
	EditLevel(http.ResponseWriter, *http.Request)
	GetLevel(http.ResponseWriter, *http.Request)
	GetLevelList(http.ResponseWriter, *http.Request)
}

LevelsAPIRouter defines the required methods for binding the api requests to a responses for the LevelsAPI The LevelsAPIRouter implementation should parse necessary information from the http request, pass the data to a LevelsAPIServicer to perform the required actions, then write the service results to the http response.

type LevelsAPIService

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

LevelsAPIService is a service that implents the logic for the LevelsAPIServicer This service should implement the business logic for every endpoint for the LevelsAPI API. Include any external packages or services that will be required by this service.

func (*LevelsAPIService) AddLevel

func (s *LevelsAPIService) AddLevel(ctx context.Context, levelName string, level Level) (ImplResponse, error)

AddLevel - Add level

func (*LevelsAPIService) EditLevel

func (s *LevelsAPIService) EditLevel(ctx context.Context, levelName string, level Level) (ImplResponse, error)

EditLevel - Edit level

func (*LevelsAPIService) GetLevel

func (s *LevelsAPIService) GetLevel(ctx context.Context, levelName string) (ImplResponse, error)

GetLevel - Get level

func (*LevelsAPIService) GetLevelList

func (s *LevelsAPIService) GetLevelList(ctx context.Context, localization string, page int32, keywords string) (ImplResponse, error)

GetLevelList - Get level list

type LevelsAPIServicer

type LevelsAPIServicer interface {
	AddLevel(context.Context, string, Level) (ImplResponse, error)
	EditLevel(context.Context, string, Level) (ImplResponse, error)
	GetLevel(context.Context, string) (ImplResponse, error)
	GetLevelList(context.Context, string, int32, string) (ImplResponse, error)
}

LevelsAPIServicer defines the api actions for the LevelsAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewLevelsAPIService

func NewLevelsAPIService(firestore *firestore.Client, cache *CacheService) LevelsAPIServicer

NewLevelsAPIService creates a default api service

type News

type News struct{ Level }

News is fake level struct that has entire level struct

func NewNews

func NewNews(title string, subTitle string, upperLeftText string, upperRightText string, iconRating int, iconText string, iconURL string, description string) News

NewNews creates a new fake level struct using specified texts

type Particle

type Particle struct {

	// english and number only name for searching
	Name string `json:"name,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// Reserved for future update. current default is 1.
	Version int32 `json:"version,omitempty" validate:"omitempty,gte=1,lte=1"`

	// base title of this content
	Title string `json:"title,omitempty" validate:"omitempty,min=1,max=100"`

	// something footer(ex. featuring xyz) for this content
	Subtitle string `json:"subtitle,omitempty" validate:"omitempty,min=1,max=100"`

	// author of this content
	Author string `json:"author,omitempty" validate:"omitempty,alphanumunicode,min=1,max=50"`

	Thumbnail SonolusResourceLocator `json:"thumbnail,omitempty" validate:"omitempty"`

	Data SonolusResourceLocator `json:"data,omitempty" validate:"omitempty"`

	Texture SonolusResourceLocator `json:"texture,omitempty" validate:"omitempty"`

	// 独自要素: データを作成したエポックミリ秒(ソート用)
	CreatedTime int32 `json:"createdTime,omitempty" validate:"omitempty,gte=1"`

	// 独自要素: データを更新したエポックミリ秒(ソート用)
	UpdatedTime int32 `json:"updatedTime,omitempty" validate:"omitempty,gte=1"`

	// 独自要素: 譜面作成者のユーザーID
	UserID string `json:"userId,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// 独自要素: サイト内および譜面情報欄に表示される説明文
	Description string `json:"description,omitempty" validate:"omitempty,min=1,max=3000"`
}

Particle - A particle provides particle effect elements to levels / It defines particle effect used for specific level https://github.com/NonSpicyBurrito/sonolus-wiki/wiki/Particle

type ParticlesAPIController

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

A ParticlesAPIController binds http requests to an api service and writes the service results to the http response

func (*ParticlesAPIController) AddParticle

func (c *ParticlesAPIController) AddParticle(w http.ResponseWriter, r *http.Request)

AddParticle - Add particle

func (*ParticlesAPIController) EditParticle

func (c *ParticlesAPIController) EditParticle(w http.ResponseWriter, r *http.Request)

EditParticle - Edit particle

func (*ParticlesAPIController) GetParticle

func (c *ParticlesAPIController) GetParticle(w http.ResponseWriter, r *http.Request)

GetParticle - Get particle

func (*ParticlesAPIController) GetParticleList

func (c *ParticlesAPIController) GetParticleList(w http.ResponseWriter, r *http.Request)

GetParticleList - Get particle list

func (*ParticlesAPIController) Routes

func (c *ParticlesAPIController) Routes() Routes

Routes returns all of the api route for the ParticlesAPIController

type ParticlesAPIRouter

type ParticlesAPIRouter interface {
	AddParticle(http.ResponseWriter, *http.Request)
	GetParticle(http.ResponseWriter, *http.Request)
	GetParticleList(http.ResponseWriter, *http.Request)
	PatchParticlesParticleName(http.ResponseWriter, *http.Request)
}

ParticlesAPIRouter defines the required methods for binding the api requests to a responses for the ParticlesAPI The ParticlesAPIRouter implementation should parse necessary information from the http request, pass the data to a ParticlesAPIServicer to perform the required actions, then write the service results to the http response.

type ParticlesAPIService

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

ParticlesAPIService is a service that implents the logic for the ParticlesAPIServicer This service should implement the business logic for every endpoint for the ParticlesAPI API. Include any external packages or services that will be required by this service.

func (*ParticlesAPIService) AddParticle

func (s *ParticlesAPIService) AddParticle(ctx context.Context, particleName string, particle Particle) (ImplResponse, error)

AddParticle - Add particle

func (*ParticlesAPIService) EditParticle

func (s *ParticlesAPIService) EditParticle(ctx context.Context, particleName string, particle Particle) (ImplResponse, error)

EditParticle - Edit particle

func (*ParticlesAPIService) GetParticle

func (s *ParticlesAPIService) GetParticle(ctx context.Context, particleName string) (ImplResponse, error)

GetParticle - Get particle

func (*ParticlesAPIService) GetParticleList

func (s *ParticlesAPIService) GetParticleList(ctx context.Context, localization string, page int32, keywords string) (ImplResponse, error)

GetParticleList - Get particle list

type ParticlesAPIServicer

type ParticlesAPIServicer interface {
	AddParticle(context.Context, string, Particle) (ImplResponse, error)
	EditParticle(context.Context, string, Particle) (ImplResponse, error)
	GetParticle(context.Context, string) (ImplResponse, error)
	GetParticleList(context.Context, string, int32, string) (ImplResponse, error)
}

ParticlesAPIServicer defines the api actions for the ParticlesAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewParticlesAPIService

func NewParticlesAPIService(firestore *firestore.Client, cache *CacheService) ParticlesAPIServicer

NewParticlesAPIService creates a default api service

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

A Route defines the parameters for an api endpoint

type Router

type Router interface {
	Routes() Routes
}

Router defines the required methods for retrieving api routes

func NewBackgroundsAPIController

func NewBackgroundsAPIController(s BackgroundsAPIServicer) Router

NewBackgroundsAPIController creates a default api controller

func NewEffectsAPIController

func NewEffectsAPIController(s EffectsAPIServicer) Router

NewEffectsAPIController creates a default api controller

func NewEnginesAPIController

func NewEnginesAPIController(s EnginesAPIServicer) Router

NewEnginesAPIController creates a default api controller

func NewInfoAPIController

func NewInfoAPIController(s InfoAPIServicer) Router

NewInfoAPIController creates a default api controller

func NewLevelsAPIController

func NewLevelsAPIController(s LevelsAPIServicer) Router

NewLevelsAPIController creates a default api controller

func NewParticlesAPIController

func NewParticlesAPIController(s ParticlesAPIServicer) Router

NewParticlesAPIController creates a default api controller

func NewSkinsAPIController

func NewSkinsAPIController(s SkinsAPIServicer) Router

NewSkinsAPIController creates a default api controller

func NewTestsAPIController

func NewTestsAPIController(s TestsAPIServicer) Router

NewTestsAPIController creates a default api controller

func NewUsersAPIController

func NewUsersAPIController(s UsersAPIServicer) Router

NewUsersAPIController creates a default api controller

type Routes

type Routes []Route

Routes are a collection of defined api endpoints

type ServerInfo

type ServerInfo struct {
	Levels []Level `json:"levels"`

	Skins []Skin `json:"skins"`

	Backgrounds []Background `json:"backgrounds"`

	Effects []Effect `json:"effects"`

	Particles []Particle `json:"particles"`

	Engines []Engine `json:"engines"`
}

ServerInfo - Response / Request struct of getServerInfo

type Skin

type Skin struct {

	// english and number only name for searching
	Name string `json:"name,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// Reserved for future update. current default is 1.
	Version int32 `json:"version,omitempty" validate:"omitempty,gte=1,lte=1"`

	// base title of this content
	Title string `json:"title,omitempty" validate:"omitempty,min=1,max=100"`

	// something footer(ex. featuring xyz) for this content
	Subtitle string `json:"subtitle,omitempty" validate:"omitempty,min=1,max=100"`

	// author of this content
	Author string `json:"author,omitempty" validate:"omitempty,min=1,max=50"`

	Thumbnail SonolusResourceLocator `json:"thumbnail,omitempty" validate:"omitempty"`

	Data SonolusResourceLocator `json:"data,omitempty" validate:"omitempty"`

	Texture SonolusResourceLocator `json:"texture,omitempty" validate:"omitempty"`

	// 独自要素: データを作成したエポックミリ秒(ソート用)
	CreatedTime int32 `json:"createdTime,omitempty" validate:"omitempty,gte=1"`

	// 独自要素: データを更新したエポックミリ秒(ソート用)
	UpdatedTime int32 `json:"updatedTime,omitempty" validate:"omitempty,gte=1"`

	// 独自要素: 譜面作成者のユーザーID
	UserID string `json:"userId,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// 独自要素: サイト内および譜面情報欄に表示される説明文
	Description string `json:"description,omitempty" validate:"omitempty,min=1,max=3000"`
}

Skin - A skin provides graphic elements to levels / It defines graphics for specific level https://github.com/NonSpicyBurrito/sonolus-wiki/wiki/Skin https://github.com/NonSpicyBurrito/sonolus-wiki/wiki/Server

type SkinsAPIController

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

A SkinsAPIController binds http requests to an api service and writes the service results to the http response

func (*SkinsAPIController) AddSkin

AddSkin - Add skin

func (*SkinsAPIController) EditSkin

func (c *SkinsAPIController) EditSkin(w http.ResponseWriter, r *http.Request)

EditSkin - Edit skin

func (*SkinsAPIController) GetSkin

GetSkin - Get skin

func (*SkinsAPIController) GetSkinList

func (c *SkinsAPIController) GetSkinList(w http.ResponseWriter, r *http.Request)

GetSkinList - Get skin list

func (*SkinsAPIController) Routes

func (c *SkinsAPIController) Routes() Routes

Routes returns all of the api route for the SkinsAPIController

type SkinsAPIRouter

type SkinsAPIRouter interface {
	AddSkin(http.ResponseWriter, *http.Request)
	EditSkin(http.ResponseWriter, *http.Request)
	GetSkin(http.ResponseWriter, *http.Request)
	GetSkinList(http.ResponseWriter, *http.Request)
}

SkinsAPIRouter defines the required methods for binding the api requests to a responses for the SkinsAPI The SkinsAPIRouter implementation should parse necessary information from the http request, pass the data to a SkinsAPIServicer to perform the required actions, then write the service results to the http response.

type SkinsAPIService

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

SkinsAPIService is a service that implents the logic for the SkinsAPIServicer This service should implement the business logic for every endpoint for the SkinsAPI API. Include any external packages or services that will be required by this service.

func (*SkinsAPIService) AddSkin

func (s *SkinsAPIService) AddSkin(ctx context.Context, skinName string, skin Skin) (ImplResponse, error)

AddSkin - Add skin

func (*SkinsAPIService) EditSkin

func (s *SkinsAPIService) EditSkin(ctx context.Context, skinName string, skin Skin) (ImplResponse, error)

EditSkin - Edit skin

func (*SkinsAPIService) GetSkin

func (s *SkinsAPIService) GetSkin(ctx context.Context, skinName string) (ImplResponse, error)

GetSkin - Get skin

func (*SkinsAPIService) GetSkinList

func (s *SkinsAPIService) GetSkinList(ctx context.Context, localization string, page int32, keywords string) (ImplResponse, error)

GetSkinList - Get skin list

type SkinsAPIServicer

type SkinsAPIServicer interface {
	AddSkin(context.Context, string, Skin) (ImplResponse, error)
	EditSkin(context.Context, string, Skin) (ImplResponse, error)
	GetSkin(context.Context, string) (ImplResponse, error)
	GetSkinList(context.Context, string, int32, string) (ImplResponse, error)
}

SkinsAPIServicer defines the api actions for the SkinsAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewSkinsAPIService

func NewSkinsAPIService(firestore *firestore.Client, cache *CacheService) SkinsAPIServicer

NewSkinsAPIService creates a default api service

type SonolusResourceLocator

type SonolusResourceLocator struct {

	// When specify type together with hash uniquely identifies a resource.
	Type string `` /* 285-byte string literal not displayed */

	// Hash is calculated using SHA1 on the resource file
	Hash string `json:"hash,omitempty" validate:"omitempty,min=40,max=40"`

	// If url starts with character /, it will be treated as relative path to server address.
	URL string `json:"url,omitempty" validate:"omitempty,min=1,max=300"`
}

SonolusResourceLocator - Sonolus Resource Locator(SRL) is used in server endpoints in order for Sonolus to locate a resource. All resources must be gzip compressed. https://github.com/NonSpicyBurrito/sonolus-wiki/wiki/Resource-and-SRL

type TestsAPIController

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

A TestsAPIController binds http requests to an api service and writes the service results to the http response

func (*TestsAPIController) GetBackgroundTest

func (c *TestsAPIController) GetBackgroundTest(w http.ResponseWriter, r *http.Request)

GetBackgroundTest - Get testing background

func (*TestsAPIController) GetEffectTest

func (c *TestsAPIController) GetEffectTest(w http.ResponseWriter, r *http.Request)

GetEffectTest - Get testing effect

func (*TestsAPIController) GetEngineTest

func (c *TestsAPIController) GetEngineTest(w http.ResponseWriter, r *http.Request)

GetEngineTest - Get testing engine

func (*TestsAPIController) GetLevelTest

func (c *TestsAPIController) GetLevelTest(w http.ResponseWriter, r *http.Request)

GetLevelTest - Get testing level

func (*TestsAPIController) GetParticleTest

func (c *TestsAPIController) GetParticleTest(w http.ResponseWriter, r *http.Request)

GetParticleTest - Get testing particle

func (*TestsAPIController) GetSkinTest

func (c *TestsAPIController) GetSkinTest(w http.ResponseWriter, r *http.Request)

GetSkinTest - Get testing skin

func (*TestsAPIController) GetTestServerInfo

func (c *TestsAPIController) GetTestServerInfo(w http.ResponseWriter, r *http.Request)

GetTestServerInfo - Get user server info

func (*TestsAPIController) GetTestsBackgrounds

func (c *TestsAPIController) GetTestsBackgrounds(w http.ResponseWriter, r *http.Request)

GetTestsBackgrounds - Get backgrounds for test

func (*TestsAPIController) GetTestsEffects

func (c *TestsAPIController) GetTestsEffects(w http.ResponseWriter, r *http.Request)

GetTestsEffects - Get effects for test

func (*TestsAPIController) GetTestsEngines

func (c *TestsAPIController) GetTestsEngines(w http.ResponseWriter, r *http.Request)

GetTestsEngines - Get engines for test

func (*TestsAPIController) GetTestsLevels

func (c *TestsAPIController) GetTestsLevels(w http.ResponseWriter, r *http.Request)

GetTestsLevels - Get levels for test

func (*TestsAPIController) GetTestsParticles

func (c *TestsAPIController) GetTestsParticles(w http.ResponseWriter, r *http.Request)

GetTestsParticles - Get particles for test

func (*TestsAPIController) GetTestsSkins

func (c *TestsAPIController) GetTestsSkins(w http.ResponseWriter, r *http.Request)

GetTestsSkins - Get skins for test

func (*TestsAPIController) Routes

func (c *TestsAPIController) Routes() Routes

Routes returns all of the api route for the TestsAPIController

type TestsAPIRouter

type TestsAPIRouter interface {
	GetTestServerInfo(http.ResponseWriter, *http.Request)
	GetTestsBackgrounds(http.ResponseWriter, *http.Request)
	GetTestsEffects(http.ResponseWriter, *http.Request)
	GetTestsEngines(http.ResponseWriter, *http.Request)
	GetTestsLevels(http.ResponseWriter, *http.Request)
	GetTestsParticles(http.ResponseWriter, *http.Request)
	GetTestsSkins(http.ResponseWriter, *http.Request)
	GetBackgroundTest(http.ResponseWriter, *http.Request)
	GetEffectTest(http.ResponseWriter, *http.Request)
	GetEngineTest(http.ResponseWriter, *http.Request)
	GetLevelTest(http.ResponseWriter, *http.Request)
	GetParticleTest(http.ResponseWriter, *http.Request)
	GetSkinTest(http.ResponseWriter, *http.Request)
}

TestsAPIRouter defines the required methods for binding the api requests to a responses for the TestsAPI The TestsAPIRouter implementation should parse necessary information from the http request, pass the data to a TestsAPIServicer to perform the required actions, then write the service results to the http response.

type TestsAPIService

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

TestsAPIService is a service that implents the logic for the TestsAPIServicer This service should implement the business logic for every endpoint for the TestsAPI API. Include any external packages or services that will be required by this service.

func (*TestsAPIService) GetBackgroundTest

func (s *TestsAPIService) GetBackgroundTest(ctx context.Context, testID string, backgroundName string) (ImplResponse, error)

GetBackgroundTest - Get testing background

func (*TestsAPIService) GetEffectTest

func (s *TestsAPIService) GetEffectTest(ctx context.Context, testID string, effectName string) (ImplResponse, error)

GetEffectTest - Get testing effect

func (*TestsAPIService) GetEngineTest

func (s *TestsAPIService) GetEngineTest(ctx context.Context, testID string, engineName string) (ImplResponse, error)

GetEngineTest - Get testing engine

func (*TestsAPIService) GetLevelTest

func (s *TestsAPIService) GetLevelTest(ctx context.Context, testID string, levelName string) (ImplResponse, error)

GetLevelTest - Get testing level

func (*TestsAPIService) GetParticleTest

func (s *TestsAPIService) GetParticleTest(ctx context.Context, testID string, particleName string) (ImplResponse, error)

GetParticleTest - Get testing particle

func (*TestsAPIService) GetSkinTest

func (s *TestsAPIService) GetSkinTest(ctx context.Context, testID string, skinName string) (ImplResponse, error)

GetSkinTest - Get testing skin

func (*TestsAPIService) GetTestServerInfo

func (s *TestsAPIService) GetTestServerInfo(ctx context.Context, testID string) (ImplResponse, error)

GetTestServerInfo - Get user server info

func (*TestsAPIService) GetTestsBackgrounds

func (s *TestsAPIService) GetTestsBackgrounds(ctx context.Context, testID string, localization string, page int32, keywords string) (ImplResponse, error)

GetTestsBackgrounds - Get backgrounds for test

func (*TestsAPIService) GetTestsEffects

func (s *TestsAPIService) GetTestsEffects(ctx context.Context, testID string, localization string, page int32, keywords string) (ImplResponse, error)

GetTestsEffects - Get effects for test

func (*TestsAPIService) GetTestsEngines

func (s *TestsAPIService) GetTestsEngines(ctx context.Context, testID string, localization string, page int32, keywords string) (ImplResponse, error)

GetTestsEngines - Get engines for test

func (*TestsAPIService) GetTestsLevels

func (s *TestsAPIService) GetTestsLevels(ctx context.Context, testID string, localization string, page int32, keywords string) (ImplResponse, error)

GetTestsLevels - Get levels for test

func (*TestsAPIService) GetTestsParticles

func (s *TestsAPIService) GetTestsParticles(ctx context.Context, testID string, localization string, page int32, keywords string) (ImplResponse, error)

GetTestsParticles - Get particles for test

func (*TestsAPIService) GetTestsSkins

func (s *TestsAPIService) GetTestsSkins(ctx context.Context, testID string, localization string, page int32, keywords string) (ImplResponse, error)

GetTestsSkins - Get skins for test

type TestsAPIServicer

type TestsAPIServicer interface {
	GetTestServerInfo(context.Context, string) (ImplResponse, error)
	GetTestsBackgrounds(context.Context, string, string, int32, string) (ImplResponse, error)
	GetTestsEffects(context.Context, string, string, int32, string) (ImplResponse, error)
	GetTestsEngines(context.Context, string, string, int32, string) (ImplResponse, error)
	GetTestsLevels(context.Context, string, string, int32, string) (ImplResponse, error)
	GetTestsParticles(context.Context, string, string, int32, string) (ImplResponse, error)
	GetTestsSkins(context.Context, string, string, int32, string) (ImplResponse, error)
	GetBackgroundTest(context.Context, string, string) (ImplResponse, error)
	GetEffectTest(context.Context, string, string) (ImplResponse, error)
	GetEngineTest(context.Context, string, string) (ImplResponse, error)
	GetLevelTest(context.Context, string, string) (ImplResponse, error)
	GetParticleTest(context.Context, string, string) (ImplResponse, error)
	GetSkinTest(context.Context, string, string) (ImplResponse, error)
}

TestsAPIServicer defines the api actions for the TestsAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewTestsAPIService

func NewTestsAPIService(firestore *firestore.Client, cache *CacheService) TestsAPIServicer

NewTestsAPIService creates a default api service

type User

type User struct {

	// FirebaseDatabase上のユーザーID
	UserID string `json:"userId,omitempty" validate:"omitempty,alphanum,min=1,max=50"`

	// テスト用サーバーのエンドポイント
	TestID string `json:"testId,omitempty" validate:"alphanum,min=1,max=50"`

	// 管理者か否か
	IsAdmin bool `json:"isAdmin,omitempty"`

	// アカウント削除フラグ(trueで削除済み扱い)
	IsDeleted bool `json:"isDeleted,omitempty"`

	// トータル譜面数
	TotalFumen int32 `json:"totalFumen,omitempty" validate:"gte=0"`

	// 独自要素: データを作成したエポックミリ秒(ソート用)
	CreatedTime int32 `json:"createdTime,omitempty" validate:"gte=1"`

	// 独自要素: データを更新したエポックミリ秒(ソート用)
	UpdatedTime int32 `json:"updatedTime,omitempty" validate:"gte=1"`

	// 独自要素: サイト内および譜面情報欄に表示される説明文
	Description string `json:"description,omitempty" validate:"min=1,max=3000"`
}

User - ユーザー情報型

type UsersAPIController

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

A UsersAPIController binds http requests to an api service and writes the service results to the http response

func (*UsersAPIController) EditUser

func (c *UsersAPIController) EditUser(w http.ResponseWriter, r *http.Request)

EditUser - Edit user

func (*UsersAPIController) GetUser

GetUser - Get user

func (*UsersAPIController) GetUserList

func (c *UsersAPIController) GetUserList(w http.ResponseWriter, r *http.Request)

GetUserList - Get user list

func (*UsersAPIController) GetUserServerInfo

func (c *UsersAPIController) GetUserServerInfo(w http.ResponseWriter, r *http.Request)

GetUserServerInfo - Get user server info

func (*UsersAPIController) GetUsersBackground

func (c *UsersAPIController) GetUsersBackground(w http.ResponseWriter, r *http.Request)

GetUsersBackground - Get users background

func (*UsersAPIController) GetUsersBackgrounds

func (c *UsersAPIController) GetUsersBackgrounds(w http.ResponseWriter, r *http.Request)

GetUsersBackgrounds - Get backgrounds for test

func (*UsersAPIController) GetUsersEffect

func (c *UsersAPIController) GetUsersEffect(w http.ResponseWriter, r *http.Request)

GetUsersEffect - Get users effect

func (*UsersAPIController) GetUsersEffects

func (c *UsersAPIController) GetUsersEffects(w http.ResponseWriter, r *http.Request)

GetUsersEffects - Get effects for test

func (*UsersAPIController) GetUsersEngine

func (c *UsersAPIController) GetUsersEngine(w http.ResponseWriter, r *http.Request)

GetUsersEngine - Get users engine

func (*UsersAPIController) GetUsersEngines

func (c *UsersAPIController) GetUsersEngines(w http.ResponseWriter, r *http.Request)

GetUsersEngines - Get engines for test

func (*UsersAPIController) GetUsersLevel

func (c *UsersAPIController) GetUsersLevel(w http.ResponseWriter, r *http.Request)

GetUsersLevel - Get users level

func (*UsersAPIController) GetUsersLevels

func (c *UsersAPIController) GetUsersLevels(w http.ResponseWriter, r *http.Request)

GetUsersLevels - Get levels for test

func (*UsersAPIController) GetUsersParticle

func (c *UsersAPIController) GetUsersParticle(w http.ResponseWriter, r *http.Request)

GetUsersParticle - Get users particle

func (*UsersAPIController) GetUsersParticles

func (c *UsersAPIController) GetUsersParticles(w http.ResponseWriter, r *http.Request)

GetUsersParticles - Get particles for test

func (*UsersAPIController) GetUsersSkin

func (c *UsersAPIController) GetUsersSkin(w http.ResponseWriter, r *http.Request)

GetUsersSkin - Get users skin

func (*UsersAPIController) GetUsersSkins

func (c *UsersAPIController) GetUsersSkins(w http.ResponseWriter, r *http.Request)

GetUsersSkins - Get skins for test

func (*UsersAPIController) Routes

func (c *UsersAPIController) Routes() Routes

Routes returns all of the api route for the UsersAPIController

type UsersAPIRouter

type UsersAPIRouter interface {
	EditUser(http.ResponseWriter, *http.Request)
	GetUser(http.ResponseWriter, *http.Request)
	GetUserList(http.ResponseWriter, *http.Request)
	GetUserServerInfo(http.ResponseWriter, *http.Request)
	GetUsersBackgrounds(http.ResponseWriter, *http.Request)
	GetUsersEffects(http.ResponseWriter, *http.Request)
	GetUsersEngines(http.ResponseWriter, *http.Request)
	GetUsersLevels(http.ResponseWriter, *http.Request)
	GetUsersParticles(http.ResponseWriter, *http.Request)
	GetUsersSkins(http.ResponseWriter, *http.Request)
	GetUsersBackground(http.ResponseWriter, *http.Request)
	GetUsersEffect(http.ResponseWriter, *http.Request)
	GetUsersEngine(http.ResponseWriter, *http.Request)
	GetUsersLevel(http.ResponseWriter, *http.Request)
	GetUsersParticle(http.ResponseWriter, *http.Request)
	GetUsersSkin(http.ResponseWriter, *http.Request)
}

UsersAPIRouter defines the required methods for binding the api requests to a responses for the UsersAPI The UsersAPIRouter implementation should parse necessary information from the http request, pass the data to a UsersAPIServicer to perform the required actions, then write the service results to the http response.

type UsersAPIService

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

UsersAPIService is a service that implents the logic for the UsersAPIServicer This service should implement the business logic for every endpoint for the UsersAPI API. Include any external packages or services that will be required by this service.

func (*UsersAPIService) EditUser

func (s *UsersAPIService) EditUser(ctx context.Context, userID string, user User) (ImplResponse, error)

EditUser - Edit user

func (*UsersAPIService) GetUser

func (s *UsersAPIService) GetUser(ctx context.Context, userID string) (ImplResponse, error)

GetUser - Get user

func (*UsersAPIService) GetUserList

func (s *UsersAPIService) GetUserList(ctx context.Context) (ImplResponse, error)

GetUserList - Get user list

func (*UsersAPIService) GetUserServerInfo

func (s *UsersAPIService) GetUserServerInfo(ctx context.Context, userID string) (ImplResponse, error)

GetUserServerInfo - Get user server info

func (*UsersAPIService) GetUsersBackground

func (s *UsersAPIService) GetUsersBackground(ctx context.Context, userID string, backgroundName string) (ImplResponse, error)

GetUsersBackground - Get users background

func (*UsersAPIService) GetUsersBackgrounds

func (s *UsersAPIService) GetUsersBackgrounds(ctx context.Context, userID string, localization string, page int32, keywords string) (ImplResponse, error)

GetUsersBackgrounds - Get backgrounds for test

func (*UsersAPIService) GetUsersEffect

func (s *UsersAPIService) GetUsersEffect(ctx context.Context, userID string, effectName string) (ImplResponse, error)

GetUsersEffect - Get users effect

func (*UsersAPIService) GetUsersEffects

func (s *UsersAPIService) GetUsersEffects(ctx context.Context, userID string, localization string, page int32, keywords string) (ImplResponse, error)

GetUsersEffects - Get effects for test

func (*UsersAPIService) GetUsersEngine

func (s *UsersAPIService) GetUsersEngine(ctx context.Context, userID string, engineName string) (ImplResponse, error)

GetUsersEngine - Get users engine

func (*UsersAPIService) GetUsersEngines

func (s *UsersAPIService) GetUsersEngines(ctx context.Context, userID string, localization string, page int32, keywords string) (ImplResponse, error)

GetUsersEngines - Get engines for test

func (*UsersAPIService) GetUsersLevel

func (s *UsersAPIService) GetUsersLevel(ctx context.Context, userID string, levelName string) (ImplResponse, error)

GetUsersLevel - Get users level

func (*UsersAPIService) GetUsersLevels

func (s *UsersAPIService) GetUsersLevels(ctx context.Context, userID string, localization string, page int32, keywords string) (ImplResponse, error)

GetUsersLevels - Get levels for test

func (*UsersAPIService) GetUsersParticle

func (s *UsersAPIService) GetUsersParticle(ctx context.Context, userID string, particleName string) (ImplResponse, error)

GetUsersParticle - Get users particle

func (*UsersAPIService) GetUsersParticles

func (s *UsersAPIService) GetUsersParticles(ctx context.Context, userID string, localization string, page int32, keywords string) (ImplResponse, error)

GetUsersParticles - Get particles for test

func (*UsersAPIService) GetUsersSkin

func (s *UsersAPIService) GetUsersSkin(ctx context.Context, userID string, skinName string) (ImplResponse, error)

GetUsersSkin - Get users skin

func (*UsersAPIService) GetUsersSkins

func (s *UsersAPIService) GetUsersSkins(ctx context.Context, userID string, localization string, page int32, keywords string) (ImplResponse, error)

GetUsersSkins - Get skins for test

type UsersAPIServicer

UsersAPIServicer defines the api actions for the UsersAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewUsersAPIService

func NewUsersAPIService(firestore *firestore.Client, cache *CacheService) UsersAPIServicer

NewUsersAPIService creates a default api service

Jump to

Keyboard shortcuts

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