controllers

package
v1.19.2-rc-multipart Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNodes is an internal error type for nodes web api controller.
	ErrNodes = errs.Class("nodes web api controller error")
)

Functions

This section is empty.

Types

type AddNodeRequest

type AddNodeRequest struct {
	ID            string `json:"id"`
	APISecret     string `json:"apiSecret"`
	PublicAddress string `json:"publicAddress"`
}

AddNodeRequest holds all data needed to add node.

type Nodes

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

Nodes is a web api controller.

func NewNodes

func NewNodes(log *zap.Logger, service *nodes.Service) *Nodes

NewNodes is a constructor for Nodes.

func (*Nodes) Add

func (controller *Nodes) Add(w http.ResponseWriter, r *http.Request)

Add handles node addition.

func (*Nodes) Delete

func (controller *Nodes) Delete(w http.ResponseWriter, r *http.Request)

Delete handles node removal.

func (*Nodes) UpdateName

func (controller *Nodes) UpdateName(w http.ResponseWriter, r *http.Request)

UpdateName is an endpoint to update node name.

type UpdateNodeNameRequest

type UpdateNodeNameRequest struct {
	Name string `json:"name"`
}

UpdateNodeNameRequest holds all data needed to add node.

Jump to

Keyboard shortcuts

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