api

package
v0.0.0-...-90c1326 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(node *core.Node, network *p2p.Network, storage *core.Storage, port int) (*API, error)

func (*API) DeleteModel

func (api *API) DeleteModel(w http.ResponseWriter, r *http.Request)

Delete model handler

func (*API) GetModel

func (api *API) GetModel(w http.ResponseWriter, r *http.Request)

Get model handler

func (*API) GetModelMetadata

func (api *API) GetModelMetadata(w http.ResponseWriter, r *http.Request)

Get model metadata handler

func (*API) GetNetworkStatus

func (api *API) GetNetworkStatus(w http.ResponseWriter, r *http.Request)

Network status handler

func (*API) GetPeers

func (api *API) GetPeers(w http.ResponseWriter, r *http.Request)

Get peers handler

func (*API) GetStorageStatus

func (api *API) GetStorageStatus(w http.ResponseWriter, r *http.Request)

Storage status handler

func (*API) HealthCheck

func (api *API) HealthCheck(w http.ResponseWriter, r *http.Request)

Health check handler

func (*API) ListModels

func (api *API) ListModels(w http.ResponseWriter, r *http.Request)

List models handler

func (*API) Start

func (api *API) Start() error

func (*API) Stop

func (api *API) Stop(ctx context.Context) error

func (*API) UploadModel

func (api *API) UploadModel(w http.ResponseWriter, r *http.Request)

Model upload handler

type APIResponse

type APIResponse struct {
	Success bool        `json:"success"`
	Message string      `json:"message,omitempty"`
	Data    interface{} `json:"data,omitempty"`
	Error   string      `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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