backend

package
v0.0.0-...-2e45453 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEndpoint = errs.Class("backend endpoint")
View Source
var ErrService = errs.Class("docker service")

ErrService - pin service error class.

View Source
var Error = errs.Class("api server")

Error is an error class for API http server error.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Address string `default:"socket:/run/guest-services/run.socket" help:"Address to listen on."`
}

APIConfig holds API endpoint configuration.

type App

type App struct {
	Log *zap.Logger

	Debug struct {
		Listener net.Listener
		Server   *debug.Server
	}

	API struct {
		Listener net.Listener
		Server   *Server
	}

	Servers  *lifecycle.Group
	Services *lifecycle.Group
}

App is the storjscan process that runs API endpoint.

architecture: Peer

func NewApp

func NewApp(log *zap.Logger, config Config) (*App, error)

NewApp creates new storjscan application instance.

func (*App) Close

func (app *App) Close() error

Close closes all the resources.

func (*App) Run

func (app *App) Run(ctx context.Context) (err error)

Run runs storjscan until it's either closed or it errors.

type Cli

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

func NewCliDispatcher

func NewCliDispatcher() *Cli

func (*Cli) Dispatch

func (c *Cli) Dispatch(cmd string, args []string) error

type Config

type Config struct {
	Debug debug.Config
	API   APIConfig
}

type Endpoint

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

func NewEndpoint

func NewEndpoint(log *zap.Logger, service *Service) *Endpoint

func (*Endpoint) Configure

func (endpoint *Endpoint) Configure(w http.ResponseWriter, r *http.Request)

func (*Endpoint) LocalImages

func (endpoint *Endpoint) LocalImages(w http.ResponseWriter, r *http.Request)

func (*Endpoint) Pull

func (endpoint *Endpoint) Pull(w http.ResponseWriter, r *http.Request)

func (*Endpoint) Push

func (endpoint *Endpoint) Push(w http.ResponseWriter, r *http.Request)

func (*Endpoint) Register

func (endpoint *Endpoint) Register(router *mux.Router)

func (*Endpoint) RemoteImages

func (endpoint *Endpoint) RemoteImages(w http.ResponseWriter, r *http.Request)

func (*Endpoint) Start

func (endpoint *Endpoint) Start(w http.ResponseWriter, r *http.Request)

func (*Endpoint) Status

func (endpoint *Endpoint) Status(w http.ResponseWriter, r *http.Request)

func (*Endpoint) Stop

func (endpoint *Endpoint) Stop(w http.ResponseWriter, r *http.Request)

type Image

type Image struct {
	Name string
	Tag  string
	Id   string
	Size string
}

type RunCfg

type RunCfg struct {
	Bucket string
	Grant  string
}

type Server

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

Server represents the backend API server.

architecture: Endpoint

func NewServer

func NewServer(log *zap.Logger, listener net.Listener) *Server

NewServer creates new API server instance.

func (*Server) Close

func (server *Server) Close() error

Close closes server and underlying listener.

func (*Server) NewAPI

func (server *Server) NewAPI(path string, register func(*mux.Router))

NewAPI creates new API route and register endpoint methods.

func (*Server) Register

func (server *Server) Register(register func(*mux.Router))

func (*Server) Run

func (server *Server) Run(ctx context.Context) (err error)

Run runs the server that host api endpoints.

type Service

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

Service for querying ERC20 token information from ethereum chain.

architecture: Service

func NewService

func NewService(log *zap.Logger) *Service

NewService creates new token service instance.

func (Service) Configure

func (s Service) Configure(bucket string, grant string) error

func (Service) Create

func (s Service) Create(bucket string, grant string) error

func (Service) LocalImages

func (s Service) LocalImages() ([]Image, error)

func (Service) Pull

func (s Service) Pull(name string, tag string) error

func (Service) Push

func (s Service) Push(name string, tag string) error

func (Service) RemoteImages

func (s Service) RemoteImages() ([]Image, error)

func (Service) Start

func (s Service) Start() error

func (Service) Status

func (s Service) Status() (string, error)

func (Service) Stop

func (s Service) Stop() error

type ServiceConfig

type ServiceConfig struct {
}

type Supervisor

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

func (*Supervisor) Configure

func (s *Supervisor) Configure(bucket string, grant string) error

func (*Supervisor) Start

func (s *Supervisor) Start() (err error)

func (*Supervisor) Status

func (s *Supervisor) Status() (string, error)

func (*Supervisor) Stop

func (s *Supervisor) Stop() error

Jump to

Keyboard shortcuts

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