beridp

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type Application

type Application struct {
	ID ApplicationID `json:"id"`
	// Дата создания приложения.
	CreatedAt time.Time `json:"created_at"`
	// Дата обновления приложения.
	UpdatedAt time.Time `json:"updated_at"`
	// Является ли приложене опубликованным.
	IsPublic bool `json:"is_public"`
	// Название приложения.
	Name string `json:"name"`
	// URL изображения приложения для лаунчера.
	IconURL string `json:"icon_url"`
	// Идентификатор Android приложения.
	PackageName string `json:"package_name"`
	// URL страницы для скачивания приложения.
	StoreURL string `json:"store_url"`
	// DeepLink для запуска приложения.
	LaunchURL string `json:"launch_url"`
	// Вступительное описание.
	Intro string `json:"intro"`
}

Приложение. Ref: #/components/schemas/Application

func (*Application) Decode

func (s *Application) Decode(d *jx.Decoder) error

Decode decodes Application from json.

func (*Application) Encode

func (s *Application) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Application) GetCreatedAt

func (s *Application) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*Application) GetID

func (s *Application) GetID() ApplicationID

GetID returns the value of ID.

func (*Application) GetIconURL

func (s *Application) GetIconURL() string

GetIconURL returns the value of IconURL.

func (*Application) GetIntro

func (s *Application) GetIntro() string

GetIntro returns the value of Intro.

func (*Application) GetIsPublic

func (s *Application) GetIsPublic() bool

GetIsPublic returns the value of IsPublic.

func (*Application) GetLaunchURL

func (s *Application) GetLaunchURL() string

GetLaunchURL returns the value of LaunchURL.

func (*Application) GetName

func (s *Application) GetName() string

GetName returns the value of Name.

func (*Application) GetPackageName

func (s *Application) GetPackageName() string

GetPackageName returns the value of PackageName.

func (*Application) GetStoreURL

func (s *Application) GetStoreURL() string

GetStoreURL returns the value of StoreURL.

func (*Application) GetUpdatedAt

func (s *Application) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*Application) MarshalJSON

func (s *Application) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Application) SetCreatedAt

func (s *Application) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*Application) SetID

func (s *Application) SetID(val ApplicationID)

SetID sets the value of ID.

func (*Application) SetIconURL

func (s *Application) SetIconURL(val string)

SetIconURL sets the value of IconURL.

func (*Application) SetIntro

func (s *Application) SetIntro(val string)

SetIntro sets the value of Intro.

func (*Application) SetIsPublic

func (s *Application) SetIsPublic(val bool)

SetIsPublic sets the value of IsPublic.

func (*Application) SetLaunchURL

func (s *Application) SetLaunchURL(val string)

SetLaunchURL sets the value of LaunchURL.

func (*Application) SetName

func (s *Application) SetName(val string)

SetName sets the value of Name.

func (*Application) SetPackageName

func (s *Application) SetPackageName(val string)

SetPackageName sets the value of PackageName.

func (*Application) SetStoreURL

func (s *Application) SetStoreURL(val string)

SetStoreURL sets the value of StoreURL.

func (*Application) SetUpdatedAt

func (s *Application) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*Application) UnmarshalJSON

func (s *Application) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ApplicationID

type ApplicationID uuid.UUID

func (*ApplicationID) Decode

func (s *ApplicationID) Decode(d *jx.Decoder) error

Decode decodes ApplicationID from json.

func (ApplicationID) Encode

func (s ApplicationID) Encode(e *jx.Encoder)

Encode encodes ApplicationID as json.

func (ApplicationID) MarshalJSON

func (s ApplicationID) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ApplicationID) UnmarshalJSON

func (s *ApplicationID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ApplicationsListIsPublic

type ApplicationsListIsPublic string
const (
	ApplicationsListIsPublicTrue  ApplicationsListIsPublic = "true"
	ApplicationsListIsPublicFalse ApplicationsListIsPublic = "false"
	ApplicationsListIsPublicAll   ApplicationsListIsPublic = "all"
)

func (ApplicationsListIsPublic) AllValues

AllValues returns all ApplicationsListIsPublic values.

func (ApplicationsListIsPublic) MarshalText

func (s ApplicationsListIsPublic) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ApplicationsListIsPublic) UnmarshalText

func (s *ApplicationsListIsPublic) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ApplicationsListIsPublic) Validate

func (s ApplicationsListIsPublic) Validate() error

type ApplicationsListOKHeaders

type ApplicationsListOKHeaders struct {
	XCount   int64
	Response []Application
}

ApplicationsListOKHeaders wraps []Application with response headers.

func (*ApplicationsListOKHeaders) GetResponse

func (s *ApplicationsListOKHeaders) GetResponse() []Application

GetResponse returns the value of Response.

func (*ApplicationsListOKHeaders) GetXCount

func (s *ApplicationsListOKHeaders) GetXCount() int64

GetXCount returns the value of XCount.

func (*ApplicationsListOKHeaders) SetResponse

func (s *ApplicationsListOKHeaders) SetResponse(val []Application)

SetResponse sets the value of Response.

func (*ApplicationsListOKHeaders) SetXCount

func (s *ApplicationsListOKHeaders) SetXCount(val int64)

SetXCount sets the value of XCount.

func (*ApplicationsListOKHeaders) Validate

func (s *ApplicationsListOKHeaders) Validate() error

type ApplicationsListOrderBy

type ApplicationsListOrderBy string
const (
	ApplicationsListOrderByCreatedAtAsc  ApplicationsListOrderBy = "created_at_asc"
	ApplicationsListOrderByCreatedAtDesc ApplicationsListOrderBy = "created_at_desc"
	ApplicationsListOrderByUpdatedAtAsc  ApplicationsListOrderBy = "updated_at_asc"
	ApplicationsListOrderByUpdatedAtDesc ApplicationsListOrderBy = "updated_at_desc"
)

func (ApplicationsListOrderBy) AllValues

AllValues returns all ApplicationsListOrderBy values.

func (ApplicationsListOrderBy) MarshalText

func (s ApplicationsListOrderBy) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ApplicationsListOrderBy) UnmarshalText

func (s *ApplicationsListOrderBy) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ApplicationsListOrderBy) Validate

func (s ApplicationsListOrderBy) Validate() error

type ApplicationsListParams

type ApplicationsListParams struct {
	Offset OptInt32
	Limit  OptInt32
	// Фильтрация по публичности приложений.
	// - true - только опубликованные
	// - false - только не опубликованные
	// - all - все.
	IsPublic OptApplicationsListIsPublic
	// Порядок сортировки результатов.
	OrderBy OptApplicationsListOrderBy
}

ApplicationsListParams is parameters of ApplicationsList operation.

type BerlogaJWT

type BerlogaJWT struct {
	APIKey string
}

func (*BerlogaJWT) GetAPIKey

func (s *BerlogaJWT) GetAPIKey() string

GetAPIKey returns the value of APIKey.

func (*BerlogaJWT) SetAPIKey

func (s *BerlogaJWT) SetAPIKey(val string)

SetAPIKey sets the value of APIKey.

type Client

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

Client implements OAS client.

func NewClient

func NewClient(serverURL string, sec SecuritySource, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) ApplicationsList

func (c *Client) ApplicationsList(ctx context.Context, params ApplicationsListParams) (*ApplicationsListOKHeaders, error)

ApplicationsList invokes ApplicationsList operation.

Список приложений. По-умолчанию сортируется по дате создания от новых к старым (`order_by=created_at_desc`) и включает в себя только опубликованные приложения (`is_public=true`).

GET /applications

func (*Client) IssueToken

func (c *Client) IssueToken(ctx context.Context, request *IssueTokenReq) (*IssueTokenCreated, error)

IssueToken invokes IssueToken operation.

Запрос аутентфикационного токена игрока. Токен имеет ограниченное непродолжительное время жизни.

POST /issue-token

func (*Client) PlayerGet

func (c *Client) PlayerGet(ctx context.Context, params PlayerGetParams) (PlayerGetRes, error)

PlayerGet invokes PlayerGet operation.

Чтение информации об игроке. По-умолчанию ответ не содержит каких-либо данных. Для того чтобы добавить в ответ какие-то из параметров игрока, нужно указать их соотвествующими параметрами запроса `get_*`.

GET /player/{player_id}

func (*Client) PlayersCreate

func (c *Client) PlayersCreate(ctx context.Context, request *PlayersCreateReq) (*PlayersCreateCreated, error)

PlayersCreate invokes PlayersCreate operation.

Регистрация нового PlayerID.

POST /players

func (*Client) PlayersMigrate

func (c *Client) PlayersMigrate(ctx context.Context, request *PlayersMigrateReq) (*PlayersMigrateOK, error)

PlayersMigrate invokes PlayersMigrate operation.

Миграция имеющихся данных о PlayerID под актуальное API сервисов Берлоги. В ответе возвращается PlayerSecret, который обязательно нужно сохранить на клиенте. Без него не получится пройти авторизацию клиентского API и они станут не доступны для этого PlayerID.

POST /players/migrate

func (*Client) TalentOAuthAuthorize

func (c *Client) TalentOAuthAuthorize(ctx context.Context, params TalentOAuthAuthorizeParams) error

TalentOAuthAuthorize invokes TalentOAuthAuthorize operation.

Авторизация существующим токеном.

POST /talent-oauth/authorize

func (*Client) TalentOAuthComplete

func (c *Client) TalentOAuthComplete(ctx context.Context, params TalentOAuthCompleteParams) (*TalentOAuthCompleteFound, error)

TalentOAuthComplete invokes TalentOAuthComplete operation.

Эндпоинт завершения авторизации Берлоги и перенаправление в приложение.

GET /talent-oauth/complete

func (*Client) TalentOAuthConnect

func (c *Client) TalentOAuthConnect(ctx context.Context, params TalentOAuthConnectParams) (*TalentOAuthConnectFound, error)

TalentOAuthConnect invokes TalentOAuthConnect operation.

Перенаправление на клиентский эндпонит OAuth авторизации Берлоги в Таланте.

GET /talent-oauth/connect

func (*Client) TalentOAuthDisconnect

func (c *Client) TalentOAuthDisconnect(ctx context.Context) error

TalentOAuthDisconnect invokes TalentOAuthDisconnect operation.

Если у игрока и так (уже) нет авторизованной учетной записи Таланта, то метод вернет `204` ответ так же как при успешном отсоединении оной.

POST /talent-oauth/disconnect

func (*Client) TalentUserPlayers

func (c *Client) TalentUserPlayers(ctx context.Context, params TalentUserPlayersParams) ([]PlayerID, error)

TalentUserPlayers invokes TalentUserPlayers operation.

Список PlayerID пользователя Таланта.

GET /talent/{talent_id}/players

func (*Client) TalentUserTokenGet

func (c *Client) TalentUserTokenGet(ctx context.Context, params TalentUserTokenGetParams) (string, error)

TalentUserTokenGet invokes TalentUserTokenGet operation.

TalentOAuth токен пользователя.

GET /talent/{talent_id}/token

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type Error

type Error struct {
	// Текстовое описание ошибки. В первую очередь
	// предназначено для разработчиков. Но в случае
	// отсуствия `verbose_message` в ответе, можно использовать и
	// `error_message`.
	ErrorMessage string `json:"error_message"`
	// Человеко-понятное описание ошибки. Присуствует
	// только в некоторых случаях.
	VerboseMessage OptString `json:"verbose_message"`
}

func (*Error) Decode

func (s *Error) Decode(d *jx.Decoder) error

Decode decodes Error from json.

func (*Error) Encode

func (s *Error) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Error) GetErrorMessage

func (s *Error) GetErrorMessage() string

GetErrorMessage returns the value of ErrorMessage.

func (*Error) GetVerboseMessage

func (s *Error) GetVerboseMessage() OptString

GetVerboseMessage returns the value of VerboseMessage.

func (*Error) MarshalJSON

func (s *Error) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetErrorMessage

func (s *Error) SetErrorMessage(val string)

SetErrorMessage sets the value of ErrorMessage.

func (*Error) SetVerboseMessage

func (s *Error) SetVerboseMessage(val OptString)

SetVerboseMessage sets the value of VerboseMessage.

func (*Error) UnmarshalJSON

func (s *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Response   Error
}

ErrorStatusCode wraps Error with StatusCode.

func (*ErrorStatusCode) Error

func (s *ErrorStatusCode) Error() string

func (*ErrorStatusCode) GetResponse

func (s *ErrorStatusCode) GetResponse() Error

GetResponse returns the value of Response.

func (*ErrorStatusCode) GetStatusCode

func (s *ErrorStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*ErrorStatusCode) SetResponse

func (s *ErrorStatusCode) SetResponse(val Error)

SetResponse sets the value of Response.

func (*ErrorStatusCode) SetStatusCode

func (s *ErrorStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type Invoker

type Invoker interface {
	// ApplicationsList invokes ApplicationsList operation.
	//
	// Список приложений.
	// По-умолчанию сортируется по дате создания от новых к
	// старым (`order_by=created_at_desc`) и включает в себя только
	// опубликованные приложения (`is_public=true`).
	//
	// GET /applications
	ApplicationsList(ctx context.Context, params ApplicationsListParams) (*ApplicationsListOKHeaders, error)
	// IssueToken invokes IssueToken operation.
	//
	// Запрос аутентфикационного токена игрока.
	// Токен имеет ограниченное непродолжительное время
	// жизни.
	//
	// POST /issue-token
	IssueToken(ctx context.Context, request *IssueTokenReq) (*IssueTokenCreated, error)
	// PlayerGet invokes PlayerGet operation.
	//
	// Чтение информации об игроке.
	// По-умолчанию ответ не содержит каких-либо данных. Для
	// того чтобы добавить в ответ какие-то из параметров
	// игрока, нужно указать их соотвествующими параметрами
	// запроса `get_*`.
	//
	// GET /player/{player_id}
	PlayerGet(ctx context.Context, params PlayerGetParams) (PlayerGetRes, error)
	// PlayersCreate invokes PlayersCreate operation.
	//
	// Регистрация нового PlayerID.
	//
	// POST /players
	PlayersCreate(ctx context.Context, request *PlayersCreateReq) (*PlayersCreateCreated, error)
	// PlayersMigrate invokes PlayersMigrate operation.
	//
	// Миграция имеющихся данных о PlayerID под актуальное API
	// сервисов Берлоги.
	// В ответе возвращается PlayerSecret, который обязательно
	// нужно сохранить на клиенте. Без него не получится
	// пройти авторизацию клиентского API и они станут не
	// доступны для этого PlayerID.
	//
	// POST /players/migrate
	PlayersMigrate(ctx context.Context, request *PlayersMigrateReq) (*PlayersMigrateOK, error)
	// TalentOAuthAuthorize invokes TalentOAuthAuthorize operation.
	//
	// Авторизация существующим токеном.
	//
	// POST /talent-oauth/authorize
	TalentOAuthAuthorize(ctx context.Context, params TalentOAuthAuthorizeParams) error
	// TalentOAuthComplete invokes TalentOAuthComplete operation.
	//
	// Эндпоинт завершения авторизации Берлоги и
	// перенаправление в приложение.
	//
	// GET /talent-oauth/complete
	TalentOAuthComplete(ctx context.Context, params TalentOAuthCompleteParams) (*TalentOAuthCompleteFound, error)
	// TalentOAuthConnect invokes TalentOAuthConnect operation.
	//
	// Перенаправление на клиентский эндпонит OAuth
	// авторизации Берлоги в Таланте.
	//
	// GET /talent-oauth/connect
	TalentOAuthConnect(ctx context.Context, params TalentOAuthConnectParams) (*TalentOAuthConnectFound, error)
	// TalentOAuthDisconnect invokes TalentOAuthDisconnect operation.
	//
	// Если у игрока и так (уже) нет авторизованной учетной
	// записи Таланта, то метод вернет `204` ответ так же как
	// при успешном отсоединении оной.
	//
	// POST /talent-oauth/disconnect
	TalentOAuthDisconnect(ctx context.Context) error
	// TalentUserPlayers invokes TalentUserPlayers operation.
	//
	// Список PlayerID пользователя Таланта.
	//
	// GET /talent/{talent_id}/players
	TalentUserPlayers(ctx context.Context, params TalentUserPlayersParams) ([]PlayerID, error)
	// TalentUserTokenGet invokes TalentUserTokenGet operation.
	//
	// TalentOAuth токен пользователя.
	//
	// GET /talent/{talent_id}/token
	TalentUserTokenGet(ctx context.Context, params TalentUserTokenGetParams) (string, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type IssueTokenCreated

type IssueTokenCreated struct {
	// Аутентификационный токен.
	Token string `json:"token"`
	// Кол-во секунд через которое истечет срок жизни токена.
	ExpiresIn int32 `json:"expires_in"`
}

func (*IssueTokenCreated) Decode

func (s *IssueTokenCreated) Decode(d *jx.Decoder) error

Decode decodes IssueTokenCreated from json.

func (*IssueTokenCreated) Encode

func (s *IssueTokenCreated) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*IssueTokenCreated) GetExpiresIn

func (s *IssueTokenCreated) GetExpiresIn() int32

GetExpiresIn returns the value of ExpiresIn.

func (*IssueTokenCreated) GetToken

func (s *IssueTokenCreated) GetToken() string

GetToken returns the value of Token.

func (*IssueTokenCreated) MarshalJSON

func (s *IssueTokenCreated) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*IssueTokenCreated) SetExpiresIn

func (s *IssueTokenCreated) SetExpiresIn(val int32)

SetExpiresIn sets the value of ExpiresIn.

func (*IssueTokenCreated) SetToken

func (s *IssueTokenCreated) SetToken(val string)

SetToken sets the value of Token.

func (*IssueTokenCreated) UnmarshalJSON

func (s *IssueTokenCreated) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type IssueTokenReq

type IssueTokenReq struct {
	ApplicationID ApplicationID `json:"application_id"`
	PlayerID      PlayerID      `json:"player_id"`
	PlayerSecret  PlayerSecret  `json:"player_secret"`
}

func (*IssueTokenReq) Decode

func (s *IssueTokenReq) Decode(d *jx.Decoder) error

Decode decodes IssueTokenReq from json.

func (*IssueTokenReq) Encode

func (s *IssueTokenReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*IssueTokenReq) GetApplicationID

func (s *IssueTokenReq) GetApplicationID() ApplicationID

GetApplicationID returns the value of ApplicationID.

func (*IssueTokenReq) GetPlayerID

func (s *IssueTokenReq) GetPlayerID() PlayerID

GetPlayerID returns the value of PlayerID.

func (*IssueTokenReq) GetPlayerSecret

func (s *IssueTokenReq) GetPlayerSecret() PlayerSecret

GetPlayerSecret returns the value of PlayerSecret.

func (*IssueTokenReq) MarshalJSON

func (s *IssueTokenReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*IssueTokenReq) SetApplicationID

func (s *IssueTokenReq) SetApplicationID(val ApplicationID)

SetApplicationID sets the value of ApplicationID.

func (*IssueTokenReq) SetPlayerID

func (s *IssueTokenReq) SetPlayerID(val PlayerID)

SetPlayerID sets the value of PlayerID.

func (*IssueTokenReq) SetPlayerSecret

func (s *IssueTokenReq) SetPlayerSecret(val PlayerSecret)

SetPlayerSecret sets the value of PlayerSecret.

func (*IssueTokenReq) UnmarshalJSON

func (s *IssueTokenReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptApplicationsListIsPublic

type OptApplicationsListIsPublic struct {
	Value ApplicationsListIsPublic
	Set   bool
}

OptApplicationsListIsPublic is optional ApplicationsListIsPublic.

func NewOptApplicationsListIsPublic

func NewOptApplicationsListIsPublic(v ApplicationsListIsPublic) OptApplicationsListIsPublic

NewOptApplicationsListIsPublic returns new OptApplicationsListIsPublic with value set to v.

func (OptApplicationsListIsPublic) Get

Get returns value and boolean that denotes whether value was set.

func (OptApplicationsListIsPublic) IsSet

IsSet returns true if OptApplicationsListIsPublic was set.

func (OptApplicationsListIsPublic) Or

Or returns value if set, or given parameter if does not.

func (*OptApplicationsListIsPublic) Reset

func (o *OptApplicationsListIsPublic) Reset()

Reset unsets value.

func (*OptApplicationsListIsPublic) SetTo

SetTo sets value to v.

type OptApplicationsListOrderBy

type OptApplicationsListOrderBy struct {
	Value ApplicationsListOrderBy
	Set   bool
}

OptApplicationsListOrderBy is optional ApplicationsListOrderBy.

func NewOptApplicationsListOrderBy

func NewOptApplicationsListOrderBy(v ApplicationsListOrderBy) OptApplicationsListOrderBy

NewOptApplicationsListOrderBy returns new OptApplicationsListOrderBy with value set to v.

func (OptApplicationsListOrderBy) Get

Get returns value and boolean that denotes whether value was set.

func (OptApplicationsListOrderBy) IsSet

func (o OptApplicationsListOrderBy) IsSet() bool

IsSet returns true if OptApplicationsListOrderBy was set.

func (OptApplicationsListOrderBy) Or

Or returns value if set, or given parameter if does not.

func (*OptApplicationsListOrderBy) Reset

func (o *OptApplicationsListOrderBy) Reset()

Reset unsets value.

func (*OptApplicationsListOrderBy) SetTo

SetTo sets value to v.

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

type OptInt32

type OptInt32 struct {
	Value int32
	Set   bool
}

OptInt32 is optional int32.

func NewOptInt32

func NewOptInt32(v int32) OptInt32

NewOptInt32 returns new OptInt32 with value set to v.

func (OptInt32) Get

func (o OptInt32) Get() (v int32, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt32) IsSet

func (o OptInt32) IsSet() bool

IsSet returns true if OptInt32 was set.

func (OptInt32) Or

func (o OptInt32) Or(d int32) int32

Or returns value if set, or given parameter if does not.

func (*OptInt32) Reset

func (o *OptInt32) Reset()

Reset unsets value.

func (*OptInt32) SetTo

func (o *OptInt32) SetTo(v int32)

SetTo sets value to v.

type OptNilInt32

type OptNilInt32 struct {
	Value int32
	Set   bool
	Null  bool
}

OptNilInt32 is optional nullable int32.

func NewOptNilInt32

func NewOptNilInt32(v int32) OptNilInt32

NewOptNilInt32 returns new OptNilInt32 with value set to v.

func (*OptNilInt32) Decode

func (o *OptNilInt32) Decode(d *jx.Decoder) error

Decode decodes int32 from json.

func (OptNilInt32) Encode

func (o OptNilInt32) Encode(e *jx.Encoder)

Encode encodes int32 as json.

func (OptNilInt32) Get

func (o OptNilInt32) Get() (v int32, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilInt32) IsNull

func (o OptNilInt32) IsNull() bool

IsSet returns true if value is Null.

func (OptNilInt32) IsSet

func (o OptNilInt32) IsSet() bool

IsSet returns true if OptNilInt32 was set.

func (OptNilInt32) MarshalJSON

func (s OptNilInt32) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilInt32) Or

func (o OptNilInt32) Or(d int32) int32

Or returns value if set, or given parameter if does not.

func (*OptNilInt32) Reset

func (o *OptNilInt32) Reset()

Reset unsets value.

func (*OptNilInt32) SetTo

func (o *OptNilInt32) SetTo(v int32)

SetTo sets value to v.

func (*OptNilInt32) SetToNull

func (o *OptNilInt32) SetToNull()

SetNull sets value to null.

func (*OptNilInt32) UnmarshalJSON

func (s *OptNilInt32) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ClientOption
}

Option is config option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type PlayerGetOK

type PlayerGetOK struct {
	// Возвращается, если передан параметр `get_talent_id=true`. Если
	// у игрока не имеется привязанной учетной записи
	// Таланта, значением будет `null`.
	TalentID OptNilInt32 `json:"talent_id"`
	// Возвращается, если передан параметр `get_player_ids=true`.
	PlayerIds []PlayerID `json:"player_ids"`
}

func (*PlayerGetOK) Decode

func (s *PlayerGetOK) Decode(d *jx.Decoder) error

Decode decodes PlayerGetOK from json.

func (*PlayerGetOK) Encode

func (s *PlayerGetOK) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayerGetOK) GetPlayerIds

func (s *PlayerGetOK) GetPlayerIds() []PlayerID

GetPlayerIds returns the value of PlayerIds.

func (*PlayerGetOK) GetTalentID

func (s *PlayerGetOK) GetTalentID() OptNilInt32

GetTalentID returns the value of TalentID.

func (*PlayerGetOK) MarshalJSON

func (s *PlayerGetOK) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayerGetOK) SetPlayerIds

func (s *PlayerGetOK) SetPlayerIds(val []PlayerID)

SetPlayerIds sets the value of PlayerIds.

func (*PlayerGetOK) SetTalentID

func (s *PlayerGetOK) SetTalentID(val OptNilInt32)

SetTalentID sets the value of TalentID.

func (*PlayerGetOK) UnmarshalJSON

func (s *PlayerGetOK) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayerGetParams

type PlayerGetParams struct {
	// PlayerID игрока.
	PlayerID PlayerID
	// Включить в ответ `talent_id`.
	GetTalentID OptBool
	// Включить в ответ `player_ids`.
	GetPlayerIds OptBool
}

PlayerGetParams is parameters of PlayerGet operation.

type PlayerGetRes

type PlayerGetRes interface {
	// contains filtered or unexported methods
}

type PlayerID

type PlayerID uuid.UUID

func (*PlayerID) Decode

func (s *PlayerID) Decode(d *jx.Decoder) error

Decode decodes PlayerID from json.

func (PlayerID) Encode

func (s PlayerID) Encode(e *jx.Encoder)

Encode encodes PlayerID as json.

func (PlayerID) MarshalJSON

func (s PlayerID) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayerID) UnmarshalJSON

func (s *PlayerID) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayerSecret

type PlayerSecret string

func (*PlayerSecret) Decode

func (s *PlayerSecret) Decode(d *jx.Decoder) error

Decode decodes PlayerSecret from json.

func (PlayerSecret) Encode

func (s PlayerSecret) Encode(e *jx.Encoder)

Encode encodes PlayerSecret as json.

func (PlayerSecret) MarshalJSON

func (s PlayerSecret) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayerSecret) UnmarshalJSON

func (s *PlayerSecret) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayersCreateCreated

type PlayersCreateCreated struct {
	PlayerID     PlayerID     `json:"player_id"`
	PlayerSecret PlayerSecret `json:"player_secret"`
}

func (*PlayersCreateCreated) Decode

func (s *PlayersCreateCreated) Decode(d *jx.Decoder) error

Decode decodes PlayersCreateCreated from json.

func (*PlayersCreateCreated) Encode

func (s *PlayersCreateCreated) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayersCreateCreated) GetPlayerID

func (s *PlayersCreateCreated) GetPlayerID() PlayerID

GetPlayerID returns the value of PlayerID.

func (*PlayersCreateCreated) GetPlayerSecret

func (s *PlayersCreateCreated) GetPlayerSecret() PlayerSecret

GetPlayerSecret returns the value of PlayerSecret.

func (*PlayersCreateCreated) MarshalJSON

func (s *PlayersCreateCreated) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayersCreateCreated) SetPlayerID

func (s *PlayersCreateCreated) SetPlayerID(val PlayerID)

SetPlayerID sets the value of PlayerID.

func (*PlayersCreateCreated) SetPlayerSecret

func (s *PlayersCreateCreated) SetPlayerSecret(val PlayerSecret)

SetPlayerSecret sets the value of PlayerSecret.

func (*PlayersCreateCreated) UnmarshalJSON

func (s *PlayersCreateCreated) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayersCreateReq

type PlayersCreateReq struct {
	ApplicationID ApplicationID `json:"application_id"`
	// DeviceID.
	DeviceID string `json:"device_id"`
}

func (*PlayersCreateReq) Decode

func (s *PlayersCreateReq) Decode(d *jx.Decoder) error

Decode decodes PlayersCreateReq from json.

func (*PlayersCreateReq) Encode

func (s *PlayersCreateReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayersCreateReq) GetApplicationID

func (s *PlayersCreateReq) GetApplicationID() ApplicationID

GetApplicationID returns the value of ApplicationID.

func (*PlayersCreateReq) GetDeviceID

func (s *PlayersCreateReq) GetDeviceID() string

GetDeviceID returns the value of DeviceID.

func (*PlayersCreateReq) MarshalJSON

func (s *PlayersCreateReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayersCreateReq) SetApplicationID

func (s *PlayersCreateReq) SetApplicationID(val ApplicationID)

SetApplicationID sets the value of ApplicationID.

func (*PlayersCreateReq) SetDeviceID

func (s *PlayersCreateReq) SetDeviceID(val string)

SetDeviceID sets the value of DeviceID.

func (*PlayersCreateReq) UnmarshalJSON

func (s *PlayersCreateReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayersMigrateOK

type PlayersMigrateOK struct {
	PlayerSecret PlayerSecret `json:"player_secret"`
}

func (*PlayersMigrateOK) Decode

func (s *PlayersMigrateOK) Decode(d *jx.Decoder) error

Decode decodes PlayersMigrateOK from json.

func (*PlayersMigrateOK) Encode

func (s *PlayersMigrateOK) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayersMigrateOK) GetPlayerSecret

func (s *PlayersMigrateOK) GetPlayerSecret() PlayerSecret

GetPlayerSecret returns the value of PlayerSecret.

func (*PlayersMigrateOK) MarshalJSON

func (s *PlayersMigrateOK) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayersMigrateOK) SetPlayerSecret

func (s *PlayersMigrateOK) SetPlayerSecret(val PlayerSecret)

SetPlayerSecret sets the value of PlayerSecret.

func (*PlayersMigrateOK) UnmarshalJSON

func (s *PlayersMigrateOK) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type PlayersMigrateReq

type PlayersMigrateReq struct {
	ApplicationID ApplicationID `json:"application_id"`
	PlayerID      PlayerID      `json:"player_id"`
}

func (*PlayersMigrateReq) Decode

func (s *PlayersMigrateReq) Decode(d *jx.Decoder) error

Decode decodes PlayersMigrateReq from json.

func (*PlayersMigrateReq) Encode

func (s *PlayersMigrateReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlayersMigrateReq) GetApplicationID

func (s *PlayersMigrateReq) GetApplicationID() ApplicationID

GetApplicationID returns the value of ApplicationID.

func (*PlayersMigrateReq) GetPlayerID

func (s *PlayersMigrateReq) GetPlayerID() PlayerID

GetPlayerID returns the value of PlayerID.

func (*PlayersMigrateReq) MarshalJSON

func (s *PlayersMigrateReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlayersMigrateReq) SetApplicationID

func (s *PlayersMigrateReq) SetApplicationID(val ApplicationID)

SetApplicationID sets the value of ApplicationID.

func (*PlayersMigrateReq) SetPlayerID

func (s *PlayersMigrateReq) SetPlayerID(val PlayerID)

SetPlayerID sets the value of PlayerID.

func (*PlayersMigrateReq) UnmarshalJSON

func (s *PlayersMigrateReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type SecuritySource

type SecuritySource interface {
	// BerlogaJWT provides BerlogaJWT security value.
	// JWT, полученный эндпоинтом [issue-token](#operation/issueToken).
	BerlogaJWT(ctx context.Context, operationName string) (BerlogaJWT, error)
	// ServiceKey provides ServiceKey security value.
	ServiceKey(ctx context.Context, operationName string) (ServiceKey, error)
	// TalentOAuth provides TalentOAuth security value.
	// JWT, полученный [OAuth провайдером платформы
	// Талант](/api/docs/).
	TalentOAuth(ctx context.Context, operationName string) (TalentOAuth, error)
}

SecuritySource is provider of security values (tokens, passwords, etc.).

type ServiceKey

type ServiceKey struct {
	APIKey string
}

func (*ServiceKey) GetAPIKey

func (s *ServiceKey) GetAPIKey() string

GetAPIKey returns the value of APIKey.

func (*ServiceKey) SetAPIKey

func (s *ServiceKey) SetAPIKey(val string)

SetAPIKey sets the value of APIKey.

type TalentOAuth

type TalentOAuth struct {
	Token string
}

func (*TalentOAuth) GetToken

func (s *TalentOAuth) GetToken() string

GetToken returns the value of Token.

func (*TalentOAuth) SetToken

func (s *TalentOAuth) SetToken(val string)

SetToken sets the value of Token.

type TalentOAuthAuthorizeOK

type TalentOAuthAuthorizeOK struct{}

TalentOAuthAuthorizeOK is response for TalentOAuthAuthorize operation.

type TalentOAuthAuthorizeParams

type TalentOAuthAuthorizeParams struct {
	// TalentOAuth access_token.
	XToken string
}

TalentOAuthAuthorizeParams is parameters of TalentOAuthAuthorize operation.

type TalentOAuthCompleteFound

type TalentOAuthCompleteFound struct {
	Location string
}

TalentOAuthCompleteFound is response for TalentOAuthComplete operation.

func (*TalentOAuthCompleteFound) GetLocation

func (s *TalentOAuthCompleteFound) GetLocation() string

GetLocation returns the value of Location.

func (*TalentOAuthCompleteFound) SetLocation

func (s *TalentOAuthCompleteFound) SetLocation(val string)

SetLocation sets the value of Location.

type TalentOAuthCompleteParams

type TalentOAuthCompleteParams struct {
	Code  string
	State uuid.UUID
}

TalentOAuthCompleteParams is parameters of TalentOAuthComplete operation.

type TalentOAuthConnectFound

type TalentOAuthConnectFound struct {
	Location string
}

TalentOAuthConnectFound is response for TalentOAuthConnect operation.

func (*TalentOAuthConnectFound) GetLocation

func (s *TalentOAuthConnectFound) GetLocation() string

GetLocation returns the value of Location.

func (*TalentOAuthConnectFound) SetLocation

func (s *TalentOAuthConnectFound) SetLocation(val string)

SetLocation sets the value of Location.

type TalentOAuthConnectParams

type TalentOAuthConnectParams struct {
	// URI перенаправления пользователя после авторизации
	// Берлоги в Таланте.
	RedirectURI OptString
}

TalentOAuthConnectParams is parameters of TalentOAuthConnect operation.

type TalentOAuthDisconnectNoContent

type TalentOAuthDisconnectNoContent struct{}

TalentOAuthDisconnectNoContent is response for TalentOAuthDisconnect operation.

type TalentUserPlayersParams

type TalentUserPlayersParams struct {
	// ID пользователя Таланта.
	TalentID int32
}

TalentUserPlayersParams is parameters of TalentUserPlayers operation.

type TalentUserTokenGetParams

type TalentUserTokenGetParams struct {
	// ID пользователя Таланта.
	TalentID int32
}

TalentUserTokenGetParams is parameters of TalentUserTokenGet operation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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