oas

package
v0.0.0-...-f028939 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: AGPL-3.0 Imports: 29 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 GetRolesForApiKeyAuth

func GetRolesForApiKeyAuth(operation string) []string

GetRolesForApiKeyAuth returns the required roles for the given operation.

This is useful for authorization scenarios where you need to know which roles are required for an operation.

Example:

requiredRoles := GetRolesForApiKeyAuth(AddPetOperation)

Returns nil if the operation has no role requirements or if the operation is unknown.

func GetRolesForBearerAuth

func GetRolesForBearerAuth(operation string) []string

GetRolesForBearerAuth returns the required roles for the given operation.

This is useful for authorization scenarios where you need to know which roles are required for an operation.

Example:

requiredRoles := GetRolesForBearerAuth(AddPetOperation)

Returns nil if the operation has no role requirements or if the operation is unknown.

func GetRolesForCookieAuth

func GetRolesForCookieAuth(operation string) []string

GetRolesForCookieAuth returns the required roles for the given operation.

This is useful for authorization scenarios where you need to know which roles are required for an operation.

Example:

requiredRoles := GetRolesForCookieAuth(AddPetOperation)

Returns nil if the operation has no role requirements or if the operation is unknown.

func WithServerURL

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

WithServerURL sets context key to override server URL.

Types

type ApiKeyAuth

type ApiKeyAuth struct {
	APIKey string
	Roles  []string
}

func (*ApiKeyAuth) GetAPIKey

func (s *ApiKeyAuth) GetAPIKey() string

GetAPIKey returns the value of APIKey.

func (*ApiKeyAuth) GetRoles

func (s *ApiKeyAuth) GetRoles() []string

GetRoles returns the value of Roles.

func (*ApiKeyAuth) SetAPIKey

func (s *ApiKeyAuth) SetAPIKey(val string)

SetAPIKey sets the value of APIKey.

func (*ApiKeyAuth) SetRoles

func (s *ApiKeyAuth) SetRoles(val []string)

SetRoles sets the value of Roles.

type BearerAuth

type BearerAuth struct {
	Token string
	Roles []string
}

func (*BearerAuth) GetRoles

func (s *BearerAuth) GetRoles() []string

GetRoles returns the value of Roles.

func (*BearerAuth) GetToken

func (s *BearerAuth) GetToken() string

GetToken returns the value of Token.

func (*BearerAuth) SetRoles

func (s *BearerAuth) SetRoles(val []string)

SetRoles sets the value of Roles.

func (*BearerAuth) SetToken

func (s *BearerAuth) SetToken(val string)

SetToken sets the value of Token.

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) CreateCollection

func (c *Client) CreateCollection(ctx context.Context, request *CollectionCreate) (*Collection, error)

CreateCollection invokes createCollection operation.

Create a collection.

POST /collections

func (*Client) CreatePlatform

func (c *Client) CreatePlatform(ctx context.Context, request *PlatformCreate) (*Platform, error)

CreatePlatform invokes createPlatform operation.

Create a platform.

POST /platforms

func (*Client) DeleteRom

func (c *Client) DeleteRom(ctx context.Context, params DeleteRomParams) error

DeleteRom invokes deleteRom operation.

Delete a ROM.

DELETE /roms/{id}

func (*Client) DownloadRom

func (c *Client) DownloadRom(ctx context.Context, params DownloadRomParams) (DownloadRomRes, error)

DownloadRom invokes downloadRom operation.

Download ROM file.

GET /roms/{id}/download

func (*Client) GetHealth

func (c *Client) GetHealth(ctx context.Context) (*HealthResponse, error)

GetHealth invokes getHealth operation.

Health check.

GET /health

func (*Client) GetPlatform

func (c *Client) GetPlatform(ctx context.Context, params GetPlatformParams) (GetPlatformRes, error)

GetPlatform invokes getPlatform operation.

Get a platform by ID.

GET /platforms/{id}

func (*Client) GetRom

func (c *Client) GetRom(ctx context.Context, params GetRomParams) (GetRomRes, error)

GetRom invokes getRom operation.

Get ROM details.

GET /roms/{id}

func (*Client) GetStats

func (c *Client) GetStats(ctx context.Context) (*Stats, error)

GetStats invokes getStats operation.

Library statistics.

GET /stats

func (*Client) ListCollections

func (c *Client) ListCollections(ctx context.Context) (*CollectionList, error)

ListCollections invokes listCollections operation.

List collections.

GET /collections

func (*Client) ListDats

func (c *Client) ListDats(ctx context.Context) (*DatFileList, error)

ListDats invokes listDats operation.

List DAT files.

GET /dats

func (*Client) ListPlatforms

func (c *Client) ListPlatforms(ctx context.Context, params ListPlatformsParams) (*PlatformList, error)

ListPlatforms invokes listPlatforms operation.

List all platforms.

GET /platforms

func (*Client) ListRoms

func (c *Client) ListRoms(ctx context.Context, params ListRomsParams) (*RomList, error)

ListRoms invokes listRoms operation.

List ROMs with filtering.

GET /roms

func (*Client) ListTasks

func (c *Client) ListTasks(ctx context.Context) (*TaskList, error)

ListTasks invokes listTasks operation.

List background tasks.

GET /tasks

func (*Client) StartScan

func (c *Client) StartScan(ctx context.Context, request *ScanRequest) (*TaskStatus, error)

StartScan invokes startScan operation.

Start a library scan.

POST /scan

func (*Client) UpdateRom

func (c *Client) UpdateRom(ctx context.Context, request *RomUpdate, params UpdateRomParams) (*Rom, error)

UpdateRom invokes updateRom operation.

Update ROM metadata.

PATCH /roms/{id}

func (*Client) UploadDat

func (c *Client) UploadDat(ctx context.Context, request *UploadDatReq) (*DatFile, error)

UploadDat invokes uploadDat operation.

Upload a DAT file.

POST /dats

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 Collection

type Collection struct {
	ID          uuid.UUID      `json:"id"`
	Name        string         `json:"name"`
	Description OptString      `json:"description"`
	Type        CollectionType `json:"type"`
	IsPublic    OptBool        `json:"is_public"`
	RomCount    OptInt         `json:"rom_count"`
	CoverPath   OptString      `json:"cover_path"`
	CreatedAt   OptDateTime    `json:"created_at"`
}

Ref: #/components/schemas/Collection

func (*Collection) Decode

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

Decode decodes Collection from json.

func (*Collection) Encode

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

Encode implements json.Marshaler.

func (*Collection) GetCoverPath

func (s *Collection) GetCoverPath() OptString

GetCoverPath returns the value of CoverPath.

func (*Collection) GetCreatedAt

func (s *Collection) GetCreatedAt() OptDateTime

GetCreatedAt returns the value of CreatedAt.

func (*Collection) GetDescription

func (s *Collection) GetDescription() OptString

GetDescription returns the value of Description.

func (*Collection) GetID

func (s *Collection) GetID() uuid.UUID

GetID returns the value of ID.

func (*Collection) GetIsPublic

func (s *Collection) GetIsPublic() OptBool

GetIsPublic returns the value of IsPublic.

func (*Collection) GetName

func (s *Collection) GetName() string

GetName returns the value of Name.

func (*Collection) GetRomCount

func (s *Collection) GetRomCount() OptInt

GetRomCount returns the value of RomCount.

func (*Collection) GetType

func (s *Collection) GetType() CollectionType

GetType returns the value of Type.

func (*Collection) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Collection) SetCoverPath

func (s *Collection) SetCoverPath(val OptString)

SetCoverPath sets the value of CoverPath.

func (*Collection) SetCreatedAt

func (s *Collection) SetCreatedAt(val OptDateTime)

SetCreatedAt sets the value of CreatedAt.

func (*Collection) SetDescription

func (s *Collection) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*Collection) SetID

func (s *Collection) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*Collection) SetIsPublic

func (s *Collection) SetIsPublic(val OptBool)

SetIsPublic sets the value of IsPublic.

func (*Collection) SetName

func (s *Collection) SetName(val string)

SetName sets the value of Name.

func (*Collection) SetRomCount

func (s *Collection) SetRomCount(val OptInt)

SetRomCount sets the value of RomCount.

func (*Collection) SetType

func (s *Collection) SetType(val CollectionType)

SetType sets the value of Type.

func (*Collection) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Collection) Validate

func (s *Collection) Validate() error

type CollectionCreate

type CollectionCreate struct {
	Name        string                    `json:"name"`
	Description OptString                 `json:"description"`
	Type        CollectionCreateType      `json:"type"`
	IsPublic    OptBool                   `json:"is_public"`
	Criteria    *CollectionCreateCriteria `json:"criteria"`
}

Ref: #/components/schemas/CollectionCreate

func (*CollectionCreate) Decode

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

Decode decodes CollectionCreate from json.

func (*CollectionCreate) Encode

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

Encode implements json.Marshaler.

func (*CollectionCreate) GetCriteria

func (s *CollectionCreate) GetCriteria() *CollectionCreateCriteria

GetCriteria returns the value of Criteria.

func (*CollectionCreate) GetDescription

func (s *CollectionCreate) GetDescription() OptString

GetDescription returns the value of Description.

func (*CollectionCreate) GetIsPublic

func (s *CollectionCreate) GetIsPublic() OptBool

GetIsPublic returns the value of IsPublic.

func (*CollectionCreate) GetName

func (s *CollectionCreate) GetName() string

GetName returns the value of Name.

func (*CollectionCreate) GetType

GetType returns the value of Type.

func (*CollectionCreate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CollectionCreate) SetCriteria

func (s *CollectionCreate) SetCriteria(val *CollectionCreateCriteria)

SetCriteria sets the value of Criteria.

func (*CollectionCreate) SetDescription

func (s *CollectionCreate) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*CollectionCreate) SetIsPublic

func (s *CollectionCreate) SetIsPublic(val OptBool)

SetIsPublic sets the value of IsPublic.

func (*CollectionCreate) SetName

func (s *CollectionCreate) SetName(val string)

SetName sets the value of Name.

func (*CollectionCreate) SetType

func (s *CollectionCreate) SetType(val CollectionCreateType)

SetType sets the value of Type.

func (*CollectionCreate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CollectionCreate) Validate

func (s *CollectionCreate) Validate() error

type CollectionCreateCriteria

type CollectionCreateCriteria struct{}

func (*CollectionCreateCriteria) Decode

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

Decode decodes CollectionCreateCriteria from json.

func (*CollectionCreateCriteria) Encode

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

Encode implements json.Marshaler.

func (*CollectionCreateCriteria) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CollectionCreateCriteria) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CollectionCreateType

type CollectionCreateType string
const (
	CollectionCreateTypeManual  CollectionCreateType = "manual"
	CollectionCreateTypeVirtual CollectionCreateType = "virtual"
	CollectionCreateTypeSmart   CollectionCreateType = "smart"
)

func (CollectionCreateType) AllValues

AllValues returns all CollectionCreateType values.

func (*CollectionCreateType) Decode

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

Decode decodes CollectionCreateType from json.

func (CollectionCreateType) Encode

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

Encode encodes CollectionCreateType as json.

func (CollectionCreateType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (CollectionCreateType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*CollectionCreateType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CollectionCreateType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (CollectionCreateType) Validate

func (s CollectionCreateType) Validate() error

type CollectionList

type CollectionList struct {
	Items []Collection `json:"items"`
	Total int          `json:"total"`
}

Ref: #/components/schemas/CollectionList

func (*CollectionList) Decode

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

Decode decodes CollectionList from json.

func (*CollectionList) Encode

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

Encode implements json.Marshaler.

func (*CollectionList) GetItems

func (s *CollectionList) GetItems() []Collection

GetItems returns the value of Items.

func (*CollectionList) GetTotal

func (s *CollectionList) GetTotal() int

GetTotal returns the value of Total.

func (*CollectionList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CollectionList) SetItems

func (s *CollectionList) SetItems(val []Collection)

SetItems sets the value of Items.

func (*CollectionList) SetTotal

func (s *CollectionList) SetTotal(val int)

SetTotal sets the value of Total.

func (*CollectionList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CollectionList) Validate

func (s *CollectionList) Validate() error

type CollectionType

type CollectionType string
const (
	CollectionTypeManual  CollectionType = "manual"
	CollectionTypeVirtual CollectionType = "virtual"
	CollectionTypeSmart   CollectionType = "smart"
)

func (CollectionType) AllValues

func (CollectionType) AllValues() []CollectionType

AllValues returns all CollectionType values.

func (*CollectionType) Decode

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

Decode decodes CollectionType from json.

func (CollectionType) Encode

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

Encode encodes CollectionType as json.

func (CollectionType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (CollectionType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*CollectionType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CollectionType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (CollectionType) Validate

func (s CollectionType) Validate() error

type CookieAuth

type CookieAuth struct {
	APIKey string
	Roles  []string
}

func (*CookieAuth) GetAPIKey

func (s *CookieAuth) GetAPIKey() string

GetAPIKey returns the value of APIKey.

func (*CookieAuth) GetRoles

func (s *CookieAuth) GetRoles() []string

GetRoles returns the value of Roles.

func (*CookieAuth) SetAPIKey

func (s *CookieAuth) SetAPIKey(val string)

SetAPIKey sets the value of APIKey.

func (*CookieAuth) SetRoles

func (s *CookieAuth) SetRoles(val []string)

SetRoles sets the value of Roles.

type DatFile

type DatFile struct {
	ID          uuid.UUID     `json:"id"`
	Name        string        `json:"name"`
	Description OptString     `json:"description"`
	Format      DatFileFormat `json:"format"`
	Source      OptString     `json:"source"`
	Version     OptString     `json:"version"`
	RomCount    OptInt        `json:"rom_count"`
	AutoUpdate  OptBool       `json:"auto_update"`
	LastUpdated OptDateTime   `json:"last_updated"`
}

Ref: #/components/schemas/DatFile

func (*DatFile) Decode

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

Decode decodes DatFile from json.

func (*DatFile) Encode

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

Encode implements json.Marshaler.

func (*DatFile) GetAutoUpdate

func (s *DatFile) GetAutoUpdate() OptBool

GetAutoUpdate returns the value of AutoUpdate.

func (*DatFile) GetDescription

func (s *DatFile) GetDescription() OptString

GetDescription returns the value of Description.

func (*DatFile) GetFormat

func (s *DatFile) GetFormat() DatFileFormat

GetFormat returns the value of Format.

func (*DatFile) GetID

func (s *DatFile) GetID() uuid.UUID

GetID returns the value of ID.

func (*DatFile) GetLastUpdated

func (s *DatFile) GetLastUpdated() OptDateTime

GetLastUpdated returns the value of LastUpdated.

func (*DatFile) GetName

func (s *DatFile) GetName() string

GetName returns the value of Name.

func (*DatFile) GetRomCount

func (s *DatFile) GetRomCount() OptInt

GetRomCount returns the value of RomCount.

func (*DatFile) GetSource

func (s *DatFile) GetSource() OptString

GetSource returns the value of Source.

func (*DatFile) GetVersion

func (s *DatFile) GetVersion() OptString

GetVersion returns the value of Version.

func (*DatFile) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*DatFile) SetAutoUpdate

func (s *DatFile) SetAutoUpdate(val OptBool)

SetAutoUpdate sets the value of AutoUpdate.

func (*DatFile) SetDescription

func (s *DatFile) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*DatFile) SetFormat

func (s *DatFile) SetFormat(val DatFileFormat)

SetFormat sets the value of Format.

func (*DatFile) SetID

func (s *DatFile) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*DatFile) SetLastUpdated

func (s *DatFile) SetLastUpdated(val OptDateTime)

SetLastUpdated sets the value of LastUpdated.

func (*DatFile) SetName

func (s *DatFile) SetName(val string)

SetName sets the value of Name.

func (*DatFile) SetRomCount

func (s *DatFile) SetRomCount(val OptInt)

SetRomCount sets the value of RomCount.

func (*DatFile) SetSource

func (s *DatFile) SetSource(val OptString)

SetSource sets the value of Source.

func (*DatFile) SetVersion

func (s *DatFile) SetVersion(val OptString)

SetVersion sets the value of Version.

func (*DatFile) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*DatFile) Validate

func (s *DatFile) Validate() error

type DatFileFormat

type DatFileFormat string
const (
	DatFileFormatLogiqx       DatFileFormat = "logiqx"
	DatFileFormatMame         DatFileFormat = "mame"
	DatFileFormatCmpro        DatFileFormat = "cmpro"
	DatFileFormatSoftwarelist DatFileFormat = "softwarelist"
	DatFileFormatSmdb         DatFileFormat = "smdb"
)

func (DatFileFormat) AllValues

func (DatFileFormat) AllValues() []DatFileFormat

AllValues returns all DatFileFormat values.

func (*DatFileFormat) Decode

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

Decode decodes DatFileFormat from json.

func (DatFileFormat) Encode

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

Encode encodes DatFileFormat as json.

func (DatFileFormat) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (DatFileFormat) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*DatFileFormat) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*DatFileFormat) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (DatFileFormat) Validate

func (s DatFileFormat) Validate() error

type DatFileList

type DatFileList struct {
	Items []DatFile `json:"items"`
	Total int       `json:"total"`
}

Ref: #/components/schemas/DatFileList

func (*DatFileList) Decode

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

Decode decodes DatFileList from json.

func (*DatFileList) Encode

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

Encode implements json.Marshaler.

func (*DatFileList) GetItems

func (s *DatFileList) GetItems() []DatFile

GetItems returns the value of Items.

func (*DatFileList) GetTotal

func (s *DatFileList) GetTotal() int

GetTotal returns the value of Total.

func (*DatFileList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*DatFileList) SetItems

func (s *DatFileList) SetItems(val []DatFile)

SetItems sets the value of Items.

func (*DatFileList) SetTotal

func (s *DatFileList) SetTotal(val int)

SetTotal sets the value of Total.

func (*DatFileList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*DatFileList) Validate

func (s *DatFileList) Validate() error

type DeleteRomNoContent

type DeleteRomNoContent struct{}

DeleteRomNoContent is response for DeleteRom operation.

type DeleteRomParams

type DeleteRomParams struct {
	ID uuid.UUID
}

DeleteRomParams is parameters of deleteRom operation.

type DownloadRomOK

type DownloadRomOK struct {
	Data io.Reader
}

func (DownloadRomOK) Read

func (s DownloadRomOK) Read(p []byte) (n int, err error)

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type DownloadRomParams

type DownloadRomParams struct {
	ID uuid.UUID
}

DownloadRomParams is parameters of downloadRom operation.

type DownloadRomRes

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

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Ref: #/components/schemas/Error

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) GetCode

func (s *Error) GetCode() int

GetCode returns the value of Code.

func (*Error) GetMessage

func (s *Error) GetMessage() string

GetMessage returns the value of Message.

func (*Error) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetCode

func (s *Error) SetCode(val int)

SetCode sets the value of Code.

func (*Error) SetMessage

func (s *Error) SetMessage(val string)

SetMessage sets the value of Message.

func (*Error) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type GetPlatformParams

type GetPlatformParams struct {
	ID uuid.UUID
}

GetPlatformParams is parameters of getPlatform operation.

type GetPlatformRes

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

type GetRomParams

type GetRomParams struct {
	ID uuid.UUID
}

GetRomParams is parameters of getRom operation.

type GetRomRes

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

type Handler

type Handler interface {
	// CreateCollection implements createCollection operation.
	//
	// Create a collection.
	//
	// POST /collections
	CreateCollection(ctx context.Context, req *CollectionCreate) (*Collection, error)
	// CreatePlatform implements createPlatform operation.
	//
	// Create a platform.
	//
	// POST /platforms
	CreatePlatform(ctx context.Context, req *PlatformCreate) (*Platform, error)
	// DeleteRom implements deleteRom operation.
	//
	// Delete a ROM.
	//
	// DELETE /roms/{id}
	DeleteRom(ctx context.Context, params DeleteRomParams) error
	// DownloadRom implements downloadRom operation.
	//
	// Download ROM file.
	//
	// GET /roms/{id}/download
	DownloadRom(ctx context.Context, params DownloadRomParams) (DownloadRomRes, error)
	// GetHealth implements getHealth operation.
	//
	// Health check.
	//
	// GET /health
	GetHealth(ctx context.Context) (*HealthResponse, error)
	// GetPlatform implements getPlatform operation.
	//
	// Get a platform by ID.
	//
	// GET /platforms/{id}
	GetPlatform(ctx context.Context, params GetPlatformParams) (GetPlatformRes, error)
	// GetRom implements getRom operation.
	//
	// Get ROM details.
	//
	// GET /roms/{id}
	GetRom(ctx context.Context, params GetRomParams) (GetRomRes, error)
	// GetStats implements getStats operation.
	//
	// Library statistics.
	//
	// GET /stats
	GetStats(ctx context.Context) (*Stats, error)
	// ListCollections implements listCollections operation.
	//
	// List collections.
	//
	// GET /collections
	ListCollections(ctx context.Context) (*CollectionList, error)
	// ListDats implements listDats operation.
	//
	// List DAT files.
	//
	// GET /dats
	ListDats(ctx context.Context) (*DatFileList, error)
	// ListPlatforms implements listPlatforms operation.
	//
	// List all platforms.
	//
	// GET /platforms
	ListPlatforms(ctx context.Context, params ListPlatformsParams) (*PlatformList, error)
	// ListRoms implements listRoms operation.
	//
	// List ROMs with filtering.
	//
	// GET /roms
	ListRoms(ctx context.Context, params ListRomsParams) (*RomList, error)
	// ListTasks implements listTasks operation.
	//
	// List background tasks.
	//
	// GET /tasks
	ListTasks(ctx context.Context) (*TaskList, error)
	// StartScan implements startScan operation.
	//
	// Start a library scan.
	//
	// POST /scan
	StartScan(ctx context.Context, req *ScanRequest) (*TaskStatus, error)
	// UpdateRom implements updateRom operation.
	//
	// Update ROM metadata.
	//
	// PATCH /roms/{id}
	UpdateRom(ctx context.Context, req *RomUpdate, params UpdateRomParams) (*Rom, error)
	// UploadDat implements uploadDat operation.
	//
	// Upload a DAT file.
	//
	// POST /dats
	UploadDat(ctx context.Context, req *UploadDatReq) (*DatFile, error)
}

Handler handles operations described by OpenAPI v3 specification.

type HealthResponse

type HealthResponse struct {
	Status          HealthResponseStatus             `json:"status"`
	Version         string                           `json:"version"`
	MetadataSources OptHealthResponseMetadataSources `json:"metadata_sources"`
}

Ref: #/components/schemas/HealthResponse

func (*HealthResponse) Decode

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

Decode decodes HealthResponse from json.

func (*HealthResponse) Encode

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

Encode implements json.Marshaler.

func (*HealthResponse) GetMetadataSources

func (s *HealthResponse) GetMetadataSources() OptHealthResponseMetadataSources

GetMetadataSources returns the value of MetadataSources.

func (*HealthResponse) GetStatus

func (s *HealthResponse) GetStatus() HealthResponseStatus

GetStatus returns the value of Status.

func (*HealthResponse) GetVersion

func (s *HealthResponse) GetVersion() string

GetVersion returns the value of Version.

func (*HealthResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*HealthResponse) SetMetadataSources

func (s *HealthResponse) SetMetadataSources(val OptHealthResponseMetadataSources)

SetMetadataSources sets the value of MetadataSources.

func (*HealthResponse) SetStatus

func (s *HealthResponse) SetStatus(val HealthResponseStatus)

SetStatus sets the value of Status.

func (*HealthResponse) SetVersion

func (s *HealthResponse) SetVersion(val string)

SetVersion sets the value of Version.

func (*HealthResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*HealthResponse) Validate

func (s *HealthResponse) Validate() error

type HealthResponseMetadataSources

type HealthResponseMetadataSources map[string]bool

func (*HealthResponseMetadataSources) Decode

Decode decodes HealthResponseMetadataSources from json.

func (HealthResponseMetadataSources) Encode

Encode implements json.Marshaler.

func (HealthResponseMetadataSources) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*HealthResponseMetadataSources) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type HealthResponseStatus

type HealthResponseStatus string
const (
	HealthResponseStatusHealthy   HealthResponseStatus = "healthy"
	HealthResponseStatusDegraded  HealthResponseStatus = "degraded"
	HealthResponseStatusUnhealthy HealthResponseStatus = "unhealthy"
)

func (HealthResponseStatus) AllValues

AllValues returns all HealthResponseStatus values.

func (*HealthResponseStatus) Decode

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

Decode decodes HealthResponseStatus from json.

func (HealthResponseStatus) Encode

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

Encode encodes HealthResponseStatus as json.

func (HealthResponseStatus) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (HealthResponseStatus) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*HealthResponseStatus) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*HealthResponseStatus) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (HealthResponseStatus) Validate

func (s HealthResponseStatus) Validate() error

type Invoker

type Invoker interface {
	// CreateCollection invokes createCollection operation.
	//
	// Create a collection.
	//
	// POST /collections
	CreateCollection(ctx context.Context, request *CollectionCreate) (*Collection, error)
	// CreatePlatform invokes createPlatform operation.
	//
	// Create a platform.
	//
	// POST /platforms
	CreatePlatform(ctx context.Context, request *PlatformCreate) (*Platform, error)
	// DeleteRom invokes deleteRom operation.
	//
	// Delete a ROM.
	//
	// DELETE /roms/{id}
	DeleteRom(ctx context.Context, params DeleteRomParams) error
	// DownloadRom invokes downloadRom operation.
	//
	// Download ROM file.
	//
	// GET /roms/{id}/download
	DownloadRom(ctx context.Context, params DownloadRomParams) (DownloadRomRes, error)
	// GetHealth invokes getHealth operation.
	//
	// Health check.
	//
	// GET /health
	GetHealth(ctx context.Context) (*HealthResponse, error)
	// GetPlatform invokes getPlatform operation.
	//
	// Get a platform by ID.
	//
	// GET /platforms/{id}
	GetPlatform(ctx context.Context, params GetPlatformParams) (GetPlatformRes, error)
	// GetRom invokes getRom operation.
	//
	// Get ROM details.
	//
	// GET /roms/{id}
	GetRom(ctx context.Context, params GetRomParams) (GetRomRes, error)
	// GetStats invokes getStats operation.
	//
	// Library statistics.
	//
	// GET /stats
	GetStats(ctx context.Context) (*Stats, error)
	// ListCollections invokes listCollections operation.
	//
	// List collections.
	//
	// GET /collections
	ListCollections(ctx context.Context) (*CollectionList, error)
	// ListDats invokes listDats operation.
	//
	// List DAT files.
	//
	// GET /dats
	ListDats(ctx context.Context) (*DatFileList, error)
	// ListPlatforms invokes listPlatforms operation.
	//
	// List all platforms.
	//
	// GET /platforms
	ListPlatforms(ctx context.Context, params ListPlatformsParams) (*PlatformList, error)
	// ListRoms invokes listRoms operation.
	//
	// List ROMs with filtering.
	//
	// GET /roms
	ListRoms(ctx context.Context, params ListRomsParams) (*RomList, error)
	// ListTasks invokes listTasks operation.
	//
	// List background tasks.
	//
	// GET /tasks
	ListTasks(ctx context.Context) (*TaskList, error)
	// StartScan invokes startScan operation.
	//
	// Start a library scan.
	//
	// POST /scan
	StartScan(ctx context.Context, request *ScanRequest) (*TaskStatus, error)
	// UpdateRom invokes updateRom operation.
	//
	// Update ROM metadata.
	//
	// PATCH /roms/{id}
	UpdateRom(ctx context.Context, request *RomUpdate, params UpdateRomParams) (*Rom, error)
	// UploadDat invokes uploadDat operation.
	//
	// Upload a DAT file.
	//
	// POST /dats
	UploadDat(ctx context.Context, request *UploadDatReq) (*DatFile, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Labeler

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

Labeler is used to allow adding custom attributes to the server request metrics.

func LabelerFromContext

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

LabelerFromContext retrieves the Labeler from the provided context, if present.

If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.

func (*Labeler) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type ListPlatformsParams

type ListPlatformsParams struct {
	Page     OptInt `json:",omitempty,omitzero"`
	PageSize OptInt `json:",omitempty,omitzero"`
}

ListPlatformsParams is parameters of listPlatforms operation.

type ListRomsParams

type ListRomsParams struct {
	Page       OptInt    `json:",omitempty,omitzero"`
	PageSize   OptInt    `json:",omitempty,omitzero"`
	PlatformID OptUUID   `json:",omitempty,omitzero"`
	Category   OptString `json:",omitempty,omitzero"`
	Search     OptString `json:",omitempty,omitzero"`
}

ListRomsParams is parameters of listRoms operation.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	CreateCollectionOperation OperationName = "CreateCollection"
	CreatePlatformOperation   OperationName = "CreatePlatform"
	DeleteRomOperation        OperationName = "DeleteRom"
	DownloadRomOperation      OperationName = "DownloadRom"
	GetHealthOperation        OperationName = "GetHealth"
	GetPlatformOperation      OperationName = "GetPlatform"
	GetRomOperation           OperationName = "GetRom"
	GetStatsOperation         OperationName = "GetStats"
	ListCollectionsOperation  OperationName = "ListCollections"
	ListDatsOperation         OperationName = "ListDats"
	ListPlatformsOperation    OperationName = "ListPlatforms"
	ListRomsOperation         OperationName = "ListRoms"
	ListTasksOperation        OperationName = "ListTasks"
	StartScanOperation        OperationName = "StartScan"
	UpdateRomOperation        OperationName = "UpdateRom"
	UploadDatOperation        OperationName = "UploadDat"
)

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) Decode

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

Decode decodes bool from json.

func (OptBool) Encode

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

Encode encodes bool as json.

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) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

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.

func (*OptBool) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptDate

type OptDate struct {
	Value time.Time
	Set   bool
}

OptDate is optional time.Time.

func NewOptDate

func NewOptDate(v time.Time) OptDate

NewOptDate returns new OptDate with value set to v.

func (*OptDate) Decode

func (o *OptDate) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDate) Encode

func (o OptDate) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDate) Get

func (o OptDate) Get() (v time.Time, ok bool)

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

func (OptDate) IsSet

func (o OptDate) IsSet() bool

IsSet returns true if OptDate was set.

func (OptDate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptDate) Or

func (o OptDate) Or(d time.Time) time.Time

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

func (*OptDate) Reset

func (o *OptDate) Reset()

Reset unsets value.

func (*OptDate) SetTo

func (o *OptDate) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

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

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

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

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFloat64

type OptFloat64 struct {
	Value float64
	Set   bool
}

OptFloat64 is optional float64.

func NewOptFloat64

func NewOptFloat64(v float64) OptFloat64

NewOptFloat64 returns new OptFloat64 with value set to v.

func (*OptFloat64) Decode

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

Decode decodes float64 from json.

func (OptFloat64) Encode

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

Encode encodes float64 as json.

func (OptFloat64) Get

func (o OptFloat64) Get() (v float64, ok bool)

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

func (OptFloat64) IsSet

func (o OptFloat64) IsSet() bool

IsSet returns true if OptFloat64 was set.

func (OptFloat64) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptFloat64) Or

func (o OptFloat64) Or(d float64) float64

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

func (*OptFloat64) Reset

func (o *OptFloat64) Reset()

Reset unsets value.

func (*OptFloat64) SetTo

func (o *OptFloat64) SetTo(v float64)

SetTo sets value to v.

func (*OptFloat64) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptHealthResponseMetadataSources

type OptHealthResponseMetadataSources struct {
	Value HealthResponseMetadataSources
	Set   bool
}

OptHealthResponseMetadataSources is optional HealthResponseMetadataSources.

func NewOptHealthResponseMetadataSources

func NewOptHealthResponseMetadataSources(v HealthResponseMetadataSources) OptHealthResponseMetadataSources

NewOptHealthResponseMetadataSources returns new OptHealthResponseMetadataSources with value set to v.

func (*OptHealthResponseMetadataSources) Decode

Decode decodes HealthResponseMetadataSources from json.

func (OptHealthResponseMetadataSources) Encode

Encode encodes HealthResponseMetadataSources as json.

func (OptHealthResponseMetadataSources) Get

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

func (OptHealthResponseMetadataSources) IsSet

IsSet returns true if OptHealthResponseMetadataSources was set.

func (OptHealthResponseMetadataSources) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptHealthResponseMetadataSources) Or

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

func (*OptHealthResponseMetadataSources) Reset

Reset unsets value.

func (*OptHealthResponseMetadataSources) SetTo

SetTo sets value to v.

func (*OptHealthResponseMetadataSources) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

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

Decode decodes int from json.

func (OptInt) Encode

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

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

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

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

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

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt64

type OptInt64 struct {
	Value int64
	Set   bool
}

OptInt64 is optional int64.

func NewOptInt64

func NewOptInt64(v int64) OptInt64

NewOptInt64 returns new OptInt64 with value set to v.

func (*OptInt64) Decode

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

Decode decodes int64 from json.

func (OptInt64) Encode

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

Encode encodes int64 as json.

func (OptInt64) Get

func (o OptInt64) Get() (v int64, ok bool)

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

func (OptInt64) IsSet

func (o OptInt64) IsSet() bool

IsSet returns true if OptInt64 was set.

func (OptInt64) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptInt64) Or

func (o OptInt64) Or(d int64) int64

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

func (*OptInt64) Reset

func (o *OptInt64) Reset()

Reset unsets value.

func (*OptInt64) SetTo

func (o *OptInt64) SetTo(v int64)

SetTo sets value to v.

func (*OptInt64) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptStatsRegionBreakdown

type OptStatsRegionBreakdown struct {
	Value StatsRegionBreakdown
	Set   bool
}

OptStatsRegionBreakdown is optional StatsRegionBreakdown.

func NewOptStatsRegionBreakdown

func NewOptStatsRegionBreakdown(v StatsRegionBreakdown) OptStatsRegionBreakdown

NewOptStatsRegionBreakdown returns new OptStatsRegionBreakdown with value set to v.

func (*OptStatsRegionBreakdown) Decode

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

Decode decodes StatsRegionBreakdown from json.

func (OptStatsRegionBreakdown) Encode

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

Encode encodes StatsRegionBreakdown as json.

func (OptStatsRegionBreakdown) Get

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

func (OptStatsRegionBreakdown) IsSet

func (o OptStatsRegionBreakdown) IsSet() bool

IsSet returns true if OptStatsRegionBreakdown was set.

func (OptStatsRegionBreakdown) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptStatsRegionBreakdown) Or

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

func (*OptStatsRegionBreakdown) Reset

func (o *OptStatsRegionBreakdown) Reset()

Reset unsets value.

func (*OptStatsRegionBreakdown) SetTo

SetTo sets value to v.

func (*OptStatsRegionBreakdown) UnmarshalJSON

func (s *OptStatsRegionBreakdown) 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 OptUUID

type OptUUID struct {
	Value uuid.UUID
	Set   bool
}

OptUUID is optional uuid.UUID.

func NewOptUUID

func NewOptUUID(v uuid.UUID) OptUUID

NewOptUUID returns new OptUUID with value set to v.

func (OptUUID) Get

func (o OptUUID) Get() (v uuid.UUID, ok bool)

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

func (OptUUID) IsSet

func (o OptUUID) IsSet() bool

IsSet returns true if OptUUID was set.

func (OptUUID) Or

func (o OptUUID) Or(d uuid.UUID) uuid.UUID

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

func (*OptUUID) Reset

func (o *OptUUID) Reset()

Reset unsets value.

func (*OptUUID) SetTo

func (o *OptUUID) SetTo(v uuid.UUID)

SetTo sets value to v.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

WithAttributes specifies default otel attributes.

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 Platform

type Platform struct {
	ID          uuid.UUID   `json:"id"`
	Slug        string      `json:"slug"`
	Name        string      `json:"name"`
	Generation  OptInt      `json:"generation"`
	Family      OptString   `json:"family"`
	IgdbID      OptInt      `json:"igdb_id"`
	SgdbID      OptInt      `json:"sgdb_id"`
	MobyID      OptInt      `json:"moby_id"`
	CoverAspect OptString   `json:"cover_aspect"`
	RomCount    OptInt      `json:"rom_count"`
	CreatedAt   OptDateTime `json:"created_at"`
	UpdatedAt   OptDateTime `json:"updated_at"`
}

Ref: #/components/schemas/Platform

func (*Platform) Decode

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

Decode decodes Platform from json.

func (*Platform) Encode

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

Encode implements json.Marshaler.

func (*Platform) GetCoverAspect

func (s *Platform) GetCoverAspect() OptString

GetCoverAspect returns the value of CoverAspect.

func (*Platform) GetCreatedAt

func (s *Platform) GetCreatedAt() OptDateTime

GetCreatedAt returns the value of CreatedAt.

func (*Platform) GetFamily

func (s *Platform) GetFamily() OptString

GetFamily returns the value of Family.

func (*Platform) GetGeneration

func (s *Platform) GetGeneration() OptInt

GetGeneration returns the value of Generation.

func (*Platform) GetID

func (s *Platform) GetID() uuid.UUID

GetID returns the value of ID.

func (*Platform) GetIgdbID

func (s *Platform) GetIgdbID() OptInt

GetIgdbID returns the value of IgdbID.

func (*Platform) GetMobyID

func (s *Platform) GetMobyID() OptInt

GetMobyID returns the value of MobyID.

func (*Platform) GetName

func (s *Platform) GetName() string

GetName returns the value of Name.

func (*Platform) GetRomCount

func (s *Platform) GetRomCount() OptInt

GetRomCount returns the value of RomCount.

func (*Platform) GetSgdbID

func (s *Platform) GetSgdbID() OptInt

GetSgdbID returns the value of SgdbID.

func (*Platform) GetSlug

func (s *Platform) GetSlug() string

GetSlug returns the value of Slug.

func (*Platform) GetUpdatedAt

func (s *Platform) GetUpdatedAt() OptDateTime

GetUpdatedAt returns the value of UpdatedAt.

func (*Platform) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Platform) SetCoverAspect

func (s *Platform) SetCoverAspect(val OptString)

SetCoverAspect sets the value of CoverAspect.

func (*Platform) SetCreatedAt

func (s *Platform) SetCreatedAt(val OptDateTime)

SetCreatedAt sets the value of CreatedAt.

func (*Platform) SetFamily

func (s *Platform) SetFamily(val OptString)

SetFamily sets the value of Family.

func (*Platform) SetGeneration

func (s *Platform) SetGeneration(val OptInt)

SetGeneration sets the value of Generation.

func (*Platform) SetID

func (s *Platform) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*Platform) SetIgdbID

func (s *Platform) SetIgdbID(val OptInt)

SetIgdbID sets the value of IgdbID.

func (*Platform) SetMobyID

func (s *Platform) SetMobyID(val OptInt)

SetMobyID sets the value of MobyID.

func (*Platform) SetName

func (s *Platform) SetName(val string)

SetName sets the value of Name.

func (*Platform) SetRomCount

func (s *Platform) SetRomCount(val OptInt)

SetRomCount sets the value of RomCount.

func (*Platform) SetSgdbID

func (s *Platform) SetSgdbID(val OptInt)

SetSgdbID sets the value of SgdbID.

func (*Platform) SetSlug

func (s *Platform) SetSlug(val string)

SetSlug sets the value of Slug.

func (*Platform) SetUpdatedAt

func (s *Platform) SetUpdatedAt(val OptDateTime)

SetUpdatedAt sets the value of UpdatedAt.

func (*Platform) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PlatformCreate

type PlatformCreate struct {
	Slug       string    `json:"slug"`
	Name       string    `json:"name"`
	Generation OptInt    `json:"generation"`
	Family     OptString `json:"family"`
}

Ref: #/components/schemas/PlatformCreate

func (*PlatformCreate) Decode

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

Decode decodes PlatformCreate from json.

func (*PlatformCreate) Encode

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

Encode implements json.Marshaler.

func (*PlatformCreate) GetFamily

func (s *PlatformCreate) GetFamily() OptString

GetFamily returns the value of Family.

func (*PlatformCreate) GetGeneration

func (s *PlatformCreate) GetGeneration() OptInt

GetGeneration returns the value of Generation.

func (*PlatformCreate) GetName

func (s *PlatformCreate) GetName() string

GetName returns the value of Name.

func (*PlatformCreate) GetSlug

func (s *PlatformCreate) GetSlug() string

GetSlug returns the value of Slug.

func (*PlatformCreate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PlatformCreate) SetFamily

func (s *PlatformCreate) SetFamily(val OptString)

SetFamily sets the value of Family.

func (*PlatformCreate) SetGeneration

func (s *PlatformCreate) SetGeneration(val OptInt)

SetGeneration sets the value of Generation.

func (*PlatformCreate) SetName

func (s *PlatformCreate) SetName(val string)

SetName sets the value of Name.

func (*PlatformCreate) SetSlug

func (s *PlatformCreate) SetSlug(val string)

SetSlug sets the value of Slug.

func (*PlatformCreate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type PlatformList

type PlatformList struct {
	Items    []Platform `json:"items"`
	Total    int        `json:"total"`
	Page     int        `json:"page"`
	PageSize int        `json:"page_size"`
}

Ref: #/components/schemas/PlatformList

func (*PlatformList) Decode

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

Decode decodes PlatformList from json.

func (*PlatformList) Encode

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

Encode implements json.Marshaler.

func (*PlatformList) GetItems

func (s *PlatformList) GetItems() []Platform

GetItems returns the value of Items.

func (*PlatformList) GetPage

func (s *PlatformList) GetPage() int

GetPage returns the value of Page.

func (*PlatformList) GetPageSize

func (s *PlatformList) GetPageSize() int

GetPageSize returns the value of PageSize.

func (*PlatformList) GetTotal

func (s *PlatformList) GetTotal() int

GetTotal returns the value of Total.

func (*PlatformList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*PlatformList) SetItems

func (s *PlatformList) SetItems(val []Platform)

SetItems sets the value of Items.

func (*PlatformList) SetPage

func (s *PlatformList) SetPage(val int)

SetPage sets the value of Page.

func (*PlatformList) SetPageSize

func (s *PlatformList) SetPageSize(val int)

SetPageSize sets the value of PageSize.

func (*PlatformList) SetTotal

func (s *PlatformList) SetTotal(val int)

SetTotal sets the value of Total.

func (*PlatformList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PlatformList) Validate

func (s *PlatformList) Validate() error

type Rom

type Rom struct {
	ID           uuid.UUID   `json:"id"`
	PlatformID   uuid.UUID   `json:"platform_id"`
	FileName     string      `json:"file_name"`
	FilePath     string      `json:"file_path"`
	FileSize     OptInt64    `json:"file_size"`
	Name         OptString   `json:"name"`
	Summary      OptString   `json:"summary"`
	Description  OptString   `json:"description"`
	Crc32        OptString   `json:"crc32"`
	MD5          OptString   `json:"md5"`
	SHA1         OptString   `json:"sha1"`
	SHA256       OptString   `json:"sha256"`
	IgdbID       OptInt      `json:"igdb_id"`
	Genres       []string    `json:"genres"`
	Franchises   []string    `json:"franchises"`
	Companies    []string    `json:"companies"`
	FirstRelease OptDate     `json:"first_release"`
	AvgRating    OptFloat64  `json:"avg_rating"`
	Category     OptString   `json:"category"`
	DatMatch     OptBool     `json:"dat_match"`
	Region       []string    `json:"region"`
	Language     []string    `json:"language"`
	MultiFile    OptBool     `json:"multi_file"`
	Media        []RomMedia  `json:"media"`
	CreatedAt    OptDateTime `json:"created_at"`
	UpdatedAt    OptDateTime `json:"updated_at"`
}

Ref: #/components/schemas/Rom

func (*Rom) Decode

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

Decode decodes Rom from json.

func (*Rom) Encode

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

Encode implements json.Marshaler.

func (*Rom) GetAvgRating

func (s *Rom) GetAvgRating() OptFloat64

GetAvgRating returns the value of AvgRating.

func (*Rom) GetCategory

func (s *Rom) GetCategory() OptString

GetCategory returns the value of Category.

func (*Rom) GetCompanies

func (s *Rom) GetCompanies() []string

GetCompanies returns the value of Companies.

func (*Rom) GetCrc32

func (s *Rom) GetCrc32() OptString

GetCrc32 returns the value of Crc32.

func (*Rom) GetCreatedAt

func (s *Rom) GetCreatedAt() OptDateTime

GetCreatedAt returns the value of CreatedAt.

func (*Rom) GetDatMatch

func (s *Rom) GetDatMatch() OptBool

GetDatMatch returns the value of DatMatch.

func (*Rom) GetDescription

func (s *Rom) GetDescription() OptString

GetDescription returns the value of Description.

func (*Rom) GetFileName

func (s *Rom) GetFileName() string

GetFileName returns the value of FileName.

func (*Rom) GetFilePath

func (s *Rom) GetFilePath() string

GetFilePath returns the value of FilePath.

func (*Rom) GetFileSize

func (s *Rom) GetFileSize() OptInt64

GetFileSize returns the value of FileSize.

func (*Rom) GetFirstRelease

func (s *Rom) GetFirstRelease() OptDate

GetFirstRelease returns the value of FirstRelease.

func (*Rom) GetFranchises

func (s *Rom) GetFranchises() []string

GetFranchises returns the value of Franchises.

func (*Rom) GetGenres

func (s *Rom) GetGenres() []string

GetGenres returns the value of Genres.

func (*Rom) GetID

func (s *Rom) GetID() uuid.UUID

GetID returns the value of ID.

func (*Rom) GetIgdbID

func (s *Rom) GetIgdbID() OptInt

GetIgdbID returns the value of IgdbID.

func (*Rom) GetLanguage

func (s *Rom) GetLanguage() []string

GetLanguage returns the value of Language.

func (*Rom) GetMD5

func (s *Rom) GetMD5() OptString

GetMD5 returns the value of MD5.

func (*Rom) GetMedia

func (s *Rom) GetMedia() []RomMedia

GetMedia returns the value of Media.

func (*Rom) GetMultiFile

func (s *Rom) GetMultiFile() OptBool

GetMultiFile returns the value of MultiFile.

func (*Rom) GetName

func (s *Rom) GetName() OptString

GetName returns the value of Name.

func (*Rom) GetPlatformID

func (s *Rom) GetPlatformID() uuid.UUID

GetPlatformID returns the value of PlatformID.

func (*Rom) GetRegion

func (s *Rom) GetRegion() []string

GetRegion returns the value of Region.

func (*Rom) GetSHA1

func (s *Rom) GetSHA1() OptString

GetSHA1 returns the value of SHA1.

func (*Rom) GetSHA256

func (s *Rom) GetSHA256() OptString

GetSHA256 returns the value of SHA256.

func (*Rom) GetSummary

func (s *Rom) GetSummary() OptString

GetSummary returns the value of Summary.

func (*Rom) GetUpdatedAt

func (s *Rom) GetUpdatedAt() OptDateTime

GetUpdatedAt returns the value of UpdatedAt.

func (*Rom) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Rom) SetAvgRating

func (s *Rom) SetAvgRating(val OptFloat64)

SetAvgRating sets the value of AvgRating.

func (*Rom) SetCategory

func (s *Rom) SetCategory(val OptString)

SetCategory sets the value of Category.

func (*Rom) SetCompanies

func (s *Rom) SetCompanies(val []string)

SetCompanies sets the value of Companies.

func (*Rom) SetCrc32

func (s *Rom) SetCrc32(val OptString)

SetCrc32 sets the value of Crc32.

func (*Rom) SetCreatedAt

func (s *Rom) SetCreatedAt(val OptDateTime)

SetCreatedAt sets the value of CreatedAt.

func (*Rom) SetDatMatch

func (s *Rom) SetDatMatch(val OptBool)

SetDatMatch sets the value of DatMatch.

func (*Rom) SetDescription

func (s *Rom) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*Rom) SetFileName

func (s *Rom) SetFileName(val string)

SetFileName sets the value of FileName.

func (*Rom) SetFilePath

func (s *Rom) SetFilePath(val string)

SetFilePath sets the value of FilePath.

func (*Rom) SetFileSize

func (s *Rom) SetFileSize(val OptInt64)

SetFileSize sets the value of FileSize.

func (*Rom) SetFirstRelease

func (s *Rom) SetFirstRelease(val OptDate)

SetFirstRelease sets the value of FirstRelease.

func (*Rom) SetFranchises

func (s *Rom) SetFranchises(val []string)

SetFranchises sets the value of Franchises.

func (*Rom) SetGenres

func (s *Rom) SetGenres(val []string)

SetGenres sets the value of Genres.

func (*Rom) SetID

func (s *Rom) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*Rom) SetIgdbID

func (s *Rom) SetIgdbID(val OptInt)

SetIgdbID sets the value of IgdbID.

func (*Rom) SetLanguage

func (s *Rom) SetLanguage(val []string)

SetLanguage sets the value of Language.

func (*Rom) SetMD5

func (s *Rom) SetMD5(val OptString)

SetMD5 sets the value of MD5.

func (*Rom) SetMedia

func (s *Rom) SetMedia(val []RomMedia)

SetMedia sets the value of Media.

func (*Rom) SetMultiFile

func (s *Rom) SetMultiFile(val OptBool)

SetMultiFile sets the value of MultiFile.

func (*Rom) SetName

func (s *Rom) SetName(val OptString)

SetName sets the value of Name.

func (*Rom) SetPlatformID

func (s *Rom) SetPlatformID(val uuid.UUID)

SetPlatformID sets the value of PlatformID.

func (*Rom) SetRegion

func (s *Rom) SetRegion(val []string)

SetRegion sets the value of Region.

func (*Rom) SetSHA1

func (s *Rom) SetSHA1(val OptString)

SetSHA1 sets the value of SHA1.

func (*Rom) SetSHA256

func (s *Rom) SetSHA256(val OptString)

SetSHA256 sets the value of SHA256.

func (*Rom) SetSummary

func (s *Rom) SetSummary(val OptString)

SetSummary sets the value of Summary.

func (*Rom) SetUpdatedAt

func (s *Rom) SetUpdatedAt(val OptDateTime)

SetUpdatedAt sets the value of UpdatedAt.

func (*Rom) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Rom) Validate

func (s *Rom) Validate() error

type RomList

type RomList struct {
	Items    []Rom `json:"items"`
	Total    int   `json:"total"`
	Page     int   `json:"page"`
	PageSize int   `json:"page_size"`
}

Ref: #/components/schemas/RomList

func (*RomList) Decode

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

Decode decodes RomList from json.

func (*RomList) Encode

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

Encode implements json.Marshaler.

func (*RomList) GetItems

func (s *RomList) GetItems() []Rom

GetItems returns the value of Items.

func (*RomList) GetPage

func (s *RomList) GetPage() int

GetPage returns the value of Page.

func (*RomList) GetPageSize

func (s *RomList) GetPageSize() int

GetPageSize returns the value of PageSize.

func (*RomList) GetTotal

func (s *RomList) GetTotal() int

GetTotal returns the value of Total.

func (*RomList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*RomList) SetItems

func (s *RomList) SetItems(val []Rom)

SetItems sets the value of Items.

func (*RomList) SetPage

func (s *RomList) SetPage(val int)

SetPage sets the value of Page.

func (*RomList) SetPageSize

func (s *RomList) SetPageSize(val int)

SetPageSize sets the value of PageSize.

func (*RomList) SetTotal

func (s *RomList) SetTotal(val int)

SetTotal sets the value of Total.

func (*RomList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RomList) Validate

func (s *RomList) Validate() error

type RomMedia

type RomMedia struct {
	ID     uuid.UUID `json:"id"`
	Type   string    `json:"type"`
	Source OptString `json:"source"`
	Path   string    `json:"path"`
	Width  OptInt    `json:"width"`
	Height OptInt    `json:"height"`
}

Ref: #/components/schemas/RomMedia

func (*RomMedia) Decode

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

Decode decodes RomMedia from json.

func (*RomMedia) Encode

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

Encode implements json.Marshaler.

func (*RomMedia) GetHeight

func (s *RomMedia) GetHeight() OptInt

GetHeight returns the value of Height.

func (*RomMedia) GetID

func (s *RomMedia) GetID() uuid.UUID

GetID returns the value of ID.

func (*RomMedia) GetPath

func (s *RomMedia) GetPath() string

GetPath returns the value of Path.

func (*RomMedia) GetSource

func (s *RomMedia) GetSource() OptString

GetSource returns the value of Source.

func (*RomMedia) GetType

func (s *RomMedia) GetType() string

GetType returns the value of Type.

func (*RomMedia) GetWidth

func (s *RomMedia) GetWidth() OptInt

GetWidth returns the value of Width.

func (*RomMedia) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*RomMedia) SetHeight

func (s *RomMedia) SetHeight(val OptInt)

SetHeight sets the value of Height.

func (*RomMedia) SetID

func (s *RomMedia) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*RomMedia) SetPath

func (s *RomMedia) SetPath(val string)

SetPath sets the value of Path.

func (*RomMedia) SetSource

func (s *RomMedia) SetSource(val OptString)

SetSource sets the value of Source.

func (*RomMedia) SetType

func (s *RomMedia) SetType(val string)

SetType sets the value of Type.

func (*RomMedia) SetWidth

func (s *RomMedia) SetWidth(val OptInt)

SetWidth sets the value of Width.

func (*RomMedia) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type RomUpdate

type RomUpdate struct {
	Name        OptString `json:"name"`
	Summary     OptString `json:"summary"`
	Description OptString `json:"description"`
	Category    OptString `json:"category"`
	IgdbID      OptInt    `json:"igdb_id"`
}

Ref: #/components/schemas/RomUpdate

func (*RomUpdate) Decode

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

Decode decodes RomUpdate from json.

func (*RomUpdate) Encode

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

Encode implements json.Marshaler.

func (*RomUpdate) GetCategory

func (s *RomUpdate) GetCategory() OptString

GetCategory returns the value of Category.

func (*RomUpdate) GetDescription

func (s *RomUpdate) GetDescription() OptString

GetDescription returns the value of Description.

func (*RomUpdate) GetIgdbID

func (s *RomUpdate) GetIgdbID() OptInt

GetIgdbID returns the value of IgdbID.

func (*RomUpdate) GetName

func (s *RomUpdate) GetName() OptString

GetName returns the value of Name.

func (*RomUpdate) GetSummary

func (s *RomUpdate) GetSummary() OptString

GetSummary returns the value of Summary.

func (*RomUpdate) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*RomUpdate) SetCategory

func (s *RomUpdate) SetCategory(val OptString)

SetCategory sets the value of Category.

func (*RomUpdate) SetDescription

func (s *RomUpdate) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*RomUpdate) SetIgdbID

func (s *RomUpdate) SetIgdbID(val OptInt)

SetIgdbID sets the value of IgdbID.

func (*RomUpdate) SetName

func (s *RomUpdate) SetName(val OptString)

SetName sets the value of Name.

func (*RomUpdate) SetSummary

func (s *RomUpdate) SetSummary(val OptString)

SetSummary sets the value of Summary.

func (*RomUpdate) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Route

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

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationGroup

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

type ScanRequest

type ScanRequest struct {
	Type        ScanRequestType `json:"type"`
	PlatformIds []uuid.UUID     `json:"platform_ids"`
}

Ref: #/components/schemas/ScanRequest

func (*ScanRequest) Decode

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

Decode decodes ScanRequest from json.

func (*ScanRequest) Encode

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

Encode implements json.Marshaler.

func (*ScanRequest) GetPlatformIds

func (s *ScanRequest) GetPlatformIds() []uuid.UUID

GetPlatformIds returns the value of PlatformIds.

func (*ScanRequest) GetType

func (s *ScanRequest) GetType() ScanRequestType

GetType returns the value of Type.

func (*ScanRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ScanRequest) SetPlatformIds

func (s *ScanRequest) SetPlatformIds(val []uuid.UUID)

SetPlatformIds sets the value of PlatformIds.

func (*ScanRequest) SetType

func (s *ScanRequest) SetType(val ScanRequestType)

SetType sets the value of Type.

func (*ScanRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ScanRequest) Validate

func (s *ScanRequest) Validate() error

type ScanRequestType

type ScanRequestType string
const (
	ScanRequestTypeQuick        ScanRequestType = "quick"
	ScanRequestTypeComplete     ScanRequestType = "complete"
	ScanRequestTypeUpdate       ScanRequestType = "update"
	ScanRequestTypeUnmatched    ScanRequestType = "unmatched"
	ScanRequestTypeHashes       ScanRequestType = "hashes"
	ScanRequestTypeNewPlatforms ScanRequestType = "new_platforms"
)

func (ScanRequestType) AllValues

func (ScanRequestType) AllValues() []ScanRequestType

AllValues returns all ScanRequestType values.

func (*ScanRequestType) Decode

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

Decode decodes ScanRequestType from json.

func (ScanRequestType) Encode

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

Encode encodes ScanRequestType as json.

func (ScanRequestType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ScanRequestType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*ScanRequestType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ScanRequestType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (ScanRequestType) Validate

func (s ScanRequestType) Validate() error

type SecurityHandler

type SecurityHandler interface {
	// HandleApiKeyAuth handles apiKeyAuth security.
	HandleApiKeyAuth(ctx context.Context, operationName OperationName, t ApiKeyAuth) (context.Context, error)
	// HandleBearerAuth handles bearerAuth security.
	HandleBearerAuth(ctx context.Context, operationName OperationName, t BearerAuth) (context.Context, error)
	// HandleCookieAuth handles cookieAuth security.
	HandleCookieAuth(ctx context.Context, operationName OperationName, t CookieAuth) (context.Context, error)
}

SecurityHandler is handler for security parameters.

type SecuritySource

type SecuritySource interface {
	// ApiKeyAuth provides apiKeyAuth security value.
	ApiKeyAuth(ctx context.Context, operationName OperationName) (ApiKeyAuth, error)
	// BearerAuth provides bearerAuth security value.
	BearerAuth(ctx context.Context, operationName OperationName) (BearerAuth, error)
	// CookieAuth provides cookieAuth security value.
	CookieAuth(ctx context.Context, operationName OperationName) (CookieAuth, error)
}

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

type Server

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

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

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

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type Stats

type Stats struct {
	PlatformCount   OptInt                  `json:"platform_count"`
	RomCount        OptInt                  `json:"rom_count"`
	SaveCount       OptInt                  `json:"save_count"`
	StateCount      OptInt                  `json:"state_count"`
	TotalFileSize   OptInt64                `json:"total_file_size"`
	DatCoveragePct  OptFloat64              `json:"dat_coverage_pct"`
	RegionBreakdown OptStatsRegionBreakdown `json:"region_breakdown"`
}

Ref: #/components/schemas/Stats

func (*Stats) Decode

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

Decode decodes Stats from json.

func (*Stats) Encode

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

Encode implements json.Marshaler.

func (*Stats) GetDatCoveragePct

func (s *Stats) GetDatCoveragePct() OptFloat64

GetDatCoveragePct returns the value of DatCoveragePct.

func (*Stats) GetPlatformCount

func (s *Stats) GetPlatformCount() OptInt

GetPlatformCount returns the value of PlatformCount.

func (*Stats) GetRegionBreakdown

func (s *Stats) GetRegionBreakdown() OptStatsRegionBreakdown

GetRegionBreakdown returns the value of RegionBreakdown.

func (*Stats) GetRomCount

func (s *Stats) GetRomCount() OptInt

GetRomCount returns the value of RomCount.

func (*Stats) GetSaveCount

func (s *Stats) GetSaveCount() OptInt

GetSaveCount returns the value of SaveCount.

func (*Stats) GetStateCount

func (s *Stats) GetStateCount() OptInt

GetStateCount returns the value of StateCount.

func (*Stats) GetTotalFileSize

func (s *Stats) GetTotalFileSize() OptInt64

GetTotalFileSize returns the value of TotalFileSize.

func (*Stats) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Stats) SetDatCoveragePct

func (s *Stats) SetDatCoveragePct(val OptFloat64)

SetDatCoveragePct sets the value of DatCoveragePct.

func (*Stats) SetPlatformCount

func (s *Stats) SetPlatformCount(val OptInt)

SetPlatformCount sets the value of PlatformCount.

func (*Stats) SetRegionBreakdown

func (s *Stats) SetRegionBreakdown(val OptStatsRegionBreakdown)

SetRegionBreakdown sets the value of RegionBreakdown.

func (*Stats) SetRomCount

func (s *Stats) SetRomCount(val OptInt)

SetRomCount sets the value of RomCount.

func (*Stats) SetSaveCount

func (s *Stats) SetSaveCount(val OptInt)

SetSaveCount sets the value of SaveCount.

func (*Stats) SetStateCount

func (s *Stats) SetStateCount(val OptInt)

SetStateCount sets the value of StateCount.

func (*Stats) SetTotalFileSize

func (s *Stats) SetTotalFileSize(val OptInt64)

SetTotalFileSize sets the value of TotalFileSize.

func (*Stats) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Stats) Validate

func (s *Stats) Validate() error

type StatsRegionBreakdown

type StatsRegionBreakdown map[string]int

func (*StatsRegionBreakdown) Decode

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

Decode decodes StatsRegionBreakdown from json.

func (StatsRegionBreakdown) Encode

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

Encode implements json.Marshaler.

func (StatsRegionBreakdown) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*StatsRegionBreakdown) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type TaskList

type TaskList struct {
	Items []TaskStatus `json:"items"`
}

Ref: #/components/schemas/TaskList

func (*TaskList) Decode

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

Decode decodes TaskList from json.

func (*TaskList) Encode

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

Encode implements json.Marshaler.

func (*TaskList) GetItems

func (s *TaskList) GetItems() []TaskStatus

GetItems returns the value of Items.

func (*TaskList) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*TaskList) SetItems

func (s *TaskList) SetItems(val []TaskStatus)

SetItems sets the value of Items.

func (*TaskList) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TaskList) Validate

func (s *TaskList) Validate() error

type TaskStatus

type TaskStatus struct {
	ID          string           `json:"id"`
	Type        string           `json:"type"`
	Status      TaskStatusStatus `json:"status"`
	Progress    OptFloat64       `json:"progress"`
	Message     OptString        `json:"message"`
	StartedAt   OptDateTime      `json:"started_at"`
	CompletedAt OptDateTime      `json:"completed_at"`
}

Ref: #/components/schemas/TaskStatus

func (*TaskStatus) Decode

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

Decode decodes TaskStatus from json.

func (*TaskStatus) Encode

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

Encode implements json.Marshaler.

func (*TaskStatus) GetCompletedAt

func (s *TaskStatus) GetCompletedAt() OptDateTime

GetCompletedAt returns the value of CompletedAt.

func (*TaskStatus) GetID

func (s *TaskStatus) GetID() string

GetID returns the value of ID.

func (*TaskStatus) GetMessage

func (s *TaskStatus) GetMessage() OptString

GetMessage returns the value of Message.

func (*TaskStatus) GetProgress

func (s *TaskStatus) GetProgress() OptFloat64

GetProgress returns the value of Progress.

func (*TaskStatus) GetStartedAt

func (s *TaskStatus) GetStartedAt() OptDateTime

GetStartedAt returns the value of StartedAt.

func (*TaskStatus) GetStatus

func (s *TaskStatus) GetStatus() TaskStatusStatus

GetStatus returns the value of Status.

func (*TaskStatus) GetType

func (s *TaskStatus) GetType() string

GetType returns the value of Type.

func (*TaskStatus) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*TaskStatus) SetCompletedAt

func (s *TaskStatus) SetCompletedAt(val OptDateTime)

SetCompletedAt sets the value of CompletedAt.

func (*TaskStatus) SetID

func (s *TaskStatus) SetID(val string)

SetID sets the value of ID.

func (*TaskStatus) SetMessage

func (s *TaskStatus) SetMessage(val OptString)

SetMessage sets the value of Message.

func (*TaskStatus) SetProgress

func (s *TaskStatus) SetProgress(val OptFloat64)

SetProgress sets the value of Progress.

func (*TaskStatus) SetStartedAt

func (s *TaskStatus) SetStartedAt(val OptDateTime)

SetStartedAt sets the value of StartedAt.

func (*TaskStatus) SetStatus

func (s *TaskStatus) SetStatus(val TaskStatusStatus)

SetStatus sets the value of Status.

func (*TaskStatus) SetType

func (s *TaskStatus) SetType(val string)

SetType sets the value of Type.

func (*TaskStatus) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TaskStatus) Validate

func (s *TaskStatus) Validate() error

type TaskStatusStatus

type TaskStatusStatus string
const (
	TaskStatusStatusPending   TaskStatusStatus = "pending"
	TaskStatusStatusRunning   TaskStatusStatus = "running"
	TaskStatusStatusCompleted TaskStatusStatus = "completed"
	TaskStatusStatusFailed    TaskStatusStatus = "failed"
)

func (TaskStatusStatus) AllValues

func (TaskStatusStatus) AllValues() []TaskStatusStatus

AllValues returns all TaskStatusStatus values.

func (*TaskStatusStatus) Decode

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

Decode decodes TaskStatusStatus from json.

func (TaskStatusStatus) Encode

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

Encode encodes TaskStatusStatus as json.

func (TaskStatusStatus) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (TaskStatusStatus) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*TaskStatusStatus) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TaskStatusStatus) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (TaskStatusStatus) Validate

func (s TaskStatusStatus) Validate() error

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) CreateCollection

func (UnimplementedHandler) CreateCollection(ctx context.Context, req *CollectionCreate) (r *Collection, _ error)

CreateCollection implements createCollection operation.

Create a collection.

POST /collections

func (UnimplementedHandler) CreatePlatform

func (UnimplementedHandler) CreatePlatform(ctx context.Context, req *PlatformCreate) (r *Platform, _ error)

CreatePlatform implements createPlatform operation.

Create a platform.

POST /platforms

func (UnimplementedHandler) DeleteRom

func (UnimplementedHandler) DeleteRom(ctx context.Context, params DeleteRomParams) error

DeleteRom implements deleteRom operation.

Delete a ROM.

DELETE /roms/{id}

func (UnimplementedHandler) DownloadRom

DownloadRom implements downloadRom operation.

Download ROM file.

GET /roms/{id}/download

func (UnimplementedHandler) GetHealth

func (UnimplementedHandler) GetHealth(ctx context.Context) (r *HealthResponse, _ error)

GetHealth implements getHealth operation.

Health check.

GET /health

func (UnimplementedHandler) GetPlatform

GetPlatform implements getPlatform operation.

Get a platform by ID.

GET /platforms/{id}

func (UnimplementedHandler) GetRom

func (UnimplementedHandler) GetRom(ctx context.Context, params GetRomParams) (r GetRomRes, _ error)

GetRom implements getRom operation.

Get ROM details.

GET /roms/{id}

func (UnimplementedHandler) GetStats

func (UnimplementedHandler) GetStats(ctx context.Context) (r *Stats, _ error)

GetStats implements getStats operation.

Library statistics.

GET /stats

func (UnimplementedHandler) ListCollections

func (UnimplementedHandler) ListCollections(ctx context.Context) (r *CollectionList, _ error)

ListCollections implements listCollections operation.

List collections.

GET /collections

func (UnimplementedHandler) ListDats

func (UnimplementedHandler) ListDats(ctx context.Context) (r *DatFileList, _ error)

ListDats implements listDats operation.

List DAT files.

GET /dats

func (UnimplementedHandler) ListPlatforms

func (UnimplementedHandler) ListPlatforms(ctx context.Context, params ListPlatformsParams) (r *PlatformList, _ error)

ListPlatforms implements listPlatforms operation.

List all platforms.

GET /platforms

func (UnimplementedHandler) ListRoms

func (UnimplementedHandler) ListRoms(ctx context.Context, params ListRomsParams) (r *RomList, _ error)

ListRoms implements listRoms operation.

List ROMs with filtering.

GET /roms

func (UnimplementedHandler) ListTasks

func (UnimplementedHandler) ListTasks(ctx context.Context) (r *TaskList, _ error)

ListTasks implements listTasks operation.

List background tasks.

GET /tasks

func (UnimplementedHandler) StartScan

func (UnimplementedHandler) StartScan(ctx context.Context, req *ScanRequest) (r *TaskStatus, _ error)

StartScan implements startScan operation.

Start a library scan.

POST /scan

func (UnimplementedHandler) UpdateRom

func (UnimplementedHandler) UpdateRom(ctx context.Context, req *RomUpdate, params UpdateRomParams) (r *Rom, _ error)

UpdateRom implements updateRom operation.

Update ROM metadata.

PATCH /roms/{id}

func (UnimplementedHandler) UploadDat

func (UnimplementedHandler) UploadDat(ctx context.Context, req *UploadDatReq) (r *DatFile, _ error)

UploadDat implements uploadDat operation.

Upload a DAT file.

POST /dats

type UpdateRomParams

type UpdateRomParams struct {
	ID uuid.UUID
}

UpdateRomParams is parameters of updateRom operation.

type UploadDatReq

type UploadDatReq struct {
	File       ht.MultipartFile `json:"file"`
	AutoUpdate OptBool          `json:"auto_update"`
}

func (*UploadDatReq) GetAutoUpdate

func (s *UploadDatReq) GetAutoUpdate() OptBool

GetAutoUpdate returns the value of AutoUpdate.

func (*UploadDatReq) GetFile

func (s *UploadDatReq) GetFile() ht.MultipartFile

GetFile returns the value of File.

func (*UploadDatReq) SetAutoUpdate

func (s *UploadDatReq) SetAutoUpdate(val OptBool)

SetAutoUpdate sets the value of AutoUpdate.

func (*UploadDatReq) SetFile

func (s *UploadDatReq) SetFile(val ht.MultipartFile)

SetFile sets the value of File.

Jump to

Keyboard shortcuts

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