api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPublicAPI

func RegisterPublicAPI(router *gin.RouterGroup)

Types

type APIService

type APIService struct {
	HTTPPort string `json:"http_port,omitempty"`

	HTTPSHost string `json:"https_host,omitempty"`
	HTTPSPort string `json:"https_port,omitempty"`

	// Status tracking for the API service.
	Status    string     `json:"status"`
	StartedAt *time.Time `json:"started_at,omitempty"`
	StoppedAt *time.Time `json:"stopped_at,omitempty"`
	// contains filtered or unexported fields
}

APIService represents the API service.

func NewAPIService

func NewAPIService(ctx context.Context, opts ...APIServiceOption) (*APIService, error)

NewAPIService creates a new APIService.

func (*APIService) RegisterModApiEndpoints

func (api *APIService) RegisterModApiEndpoints(router *gin.RouterGroup)

func (*APIService) Start

func (api *APIService) Start() error

Start starts services managed by the Manager.

type APIServiceOption

type APIServiceOption func(*APIService) error

APIServiceOption defines a type of function to configures the APIService.

func WithWebSocket

func WithWebSocket(webSocket *melody.Melody) APIServiceOption

func WithWorkspace

func WithWorkspace(workspace *workspace.Workspace) APIServiceOption

type GetModResponse

type GetModResponse struct {
	Items []Mod `json:"items"`
}

type InstallModRequest

type InstallModRequest struct {
	Names  []string `json:"names"`
	DryRun *bool    `json:"dry_run"`
	Force  *bool    `json:"force"`
}

type InstallModResponse

type InstallModResponse struct {
	Installed   *versionmap.DependencyVersionMap `json:"installed"`
	Uninstalled *versionmap.DependencyVersionMap `json:"uninstalled"`
	Downgraded  *versionmap.DependencyVersionMap `json:"downgraded"`
	Upgraded    *versionmap.DependencyVersionMap `json:"upgraded"`
}

type Mod

type Mod struct {
	Id          *string `json:"id"`
	Name        *string `json:"name"`
	Description *string `json:"description"`
	Title       *string `json:"title"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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