rest

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(baseURL string, configs ...config) *clientImpl

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) config

Types

type Client

type Client interface {
	ServerBaseURL() string
	GetHealthStatus() (*rest.HealthStatus, error)
	GetVersionInfo() (*rest.VersionInfo, error)
	GetModIDs(limit int, after string, before string) ([]string, error)
	GetMod(modID string) (*modmgr.Mod, error)
	GetModVersionIDs(modID string, limit int, after string) ([]string, error)
	GetModVersion(modID string, versionID string) (*modmgr.ModVersion, error)
	GetLatestModVersion(modID string) (*modmgr.ModVersion, error)
	GetModThumbnail(modID string) ([]byte, error)
	CheckForUpdates(installedVersions map[string]string) (map[string]*modmgr.ModVersion, error)
	ShareGame(aupack []byte, room rest.RoomInfo) (*rest.ShareGameResponse, error)
	UpdateSharedGameExpiration(sessionID, hostKey string) (*rest.ShareGameResponse, error)
	DeleteSharedGame(sessionID, hostKey string) error
	GetJoinGameDownload(sessionID string) (*rest.JoinGameDownloadResponse, error)
}

type FileClient

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

func NewFileClient

func NewFileClient(file string) (*FileClient, error)

func (*FileClient) CheckForUpdates added in v1.2.0

func (f *FileClient) CheckForUpdates(installedVersions map[string]string) (map[string]*modmgr.ModVersion, error)

func (*FileClient) DeleteSharedGame added in v1.6.0

func (f *FileClient) DeleteSharedGame(sessionID, hostKey string) error

func (*FileClient) GetHealthStatus

func (f *FileClient) GetHealthStatus() (*rest.HealthStatus, error)

func (*FileClient) GetJoinGameDownload added in v1.6.0

func (f *FileClient) GetJoinGameDownload(sessionID string) (*rest.JoinGameDownloadResponse, error)

func (*FileClient) GetLatestModVersion added in v1.1.0

func (f *FileClient) GetLatestModVersion(modID string) (*modmgr.ModVersion, error)

func (*FileClient) GetMod

func (f *FileClient) GetMod(modID string) (*modmgr.Mod, error)

func (*FileClient) GetModIDs added in v1.2.0

func (f *FileClient) GetModIDs(limit int, after string, before string) ([]string, error)

func (*FileClient) GetModThumbnail added in v1.5.0

func (f *FileClient) GetModThumbnail(modID string) ([]byte, error)

func (*FileClient) GetModVersion

func (f *FileClient) GetModVersion(modID string, versionID string) (*modmgr.ModVersion, error)

func (*FileClient) GetModVersionIDs added in v1.2.0

func (f *FileClient) GetModVersionIDs(modID string, limit int, after string) ([]string, error)

func (*FileClient) GetVersionInfo added in v1.9.1

func (f *FileClient) GetVersionInfo() (*rest.VersionInfo, error)

func (*FileClient) LoadData

func (f *FileClient) LoadData() error

func (*FileClient) ServerBaseURL added in v1.6.0

func (f *FileClient) ServerBaseURL() string

func (*FileClient) ShareGame added in v1.6.0

func (f *FileClient) ShareGame(aupack []byte, room rest.RoomInfo) (*rest.ShareGameResponse, error)

func (*FileClient) UpdateSharedGameExpiration added in v1.8.1

func (f *FileClient) UpdateSharedGameExpiration(sessionID, hostKey string) (*rest.ShareGameResponse, error)

type OfflineClient

type OfflineClient struct{}

func NewOfflineClient

func NewOfflineClient() *OfflineClient

func (*OfflineClient) CheckForUpdates added in v1.2.0

func (c *OfflineClient) CheckForUpdates(installedVersions map[string]string) (map[string]*modmgr.ModVersion, error)

func (*OfflineClient) DeleteSharedGame added in v1.6.0

func (c *OfflineClient) DeleteSharedGame(sessionID, hostKey string) error

func (*OfflineClient) GetHealthStatus

func (c *OfflineClient) GetHealthStatus() (*rest.HealthStatus, error)

func (*OfflineClient) GetJoinGameDownload added in v1.6.0

func (c *OfflineClient) GetJoinGameDownload(sessionID string) (*rest.JoinGameDownloadResponse, error)

func (*OfflineClient) GetLatestModVersion added in v1.1.0

func (c *OfflineClient) GetLatestModVersion(modID string) (*modmgr.ModVersion, error)

func (*OfflineClient) GetMod

func (c *OfflineClient) GetMod(modID string) (*modmgr.Mod, error)

func (*OfflineClient) GetModIDs added in v1.2.0

func (c *OfflineClient) GetModIDs(limit int, after string, before string) ([]string, error)

func (*OfflineClient) GetModThumbnail added in v1.5.0

func (c *OfflineClient) GetModThumbnail(modID string) ([]byte, error)

func (*OfflineClient) GetModVersion

func (c *OfflineClient) GetModVersion(modID string, versionID string) (*modmgr.ModVersion, error)

func (*OfflineClient) GetModVersionIDs added in v1.2.0

func (c *OfflineClient) GetModVersionIDs(modID string, limit int, after string) ([]string, error)

func (*OfflineClient) GetVersionInfo added in v1.9.1

func (c *OfflineClient) GetVersionInfo() (*rest.VersionInfo, error)

func (*OfflineClient) ServerBaseURL added in v1.6.0

func (c *OfflineClient) ServerBaseURL() string

func (*OfflineClient) ShareGame added in v1.6.0

func (c *OfflineClient) ShareGame(aupack []byte, room rest.RoomInfo) (*rest.ShareGameResponse, error)

func (*OfflineClient) UpdateSharedGameExpiration added in v1.8.1

func (c *OfflineClient) UpdateSharedGameExpiration(sessionID, hostKey string) (*rest.ShareGameResponse, error)

Jump to

Keyboard shortcuts

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