adminserver

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0, MIT Imports: 20 Imported by: 0

Documentation

Overview

Package adminserver provides a HTTP server that allows to perform administrative operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectReq

type ConnectReq struct {
	Maddr string `json:"maddr"`
}

ConnectReq request to connect to a given multiaddr.

func (*ConnectReq) ReadFrom

func (er *ConnectReq) ReadFrom(r io.Reader) (int64, error)

func (*ConnectReq) WriteTo

func (er *ConnectReq) WriteTo(w io.Writer) (int64, error)

type ConnectRes

type ConnectRes struct {
}

ConnectRes represents successful response to ConnectReq request.

func (*ConnectRes) ReadFrom

func (er *ConnectRes) ReadFrom(r io.Reader) (int64, error)

func (*ConnectRes) WriteTo

func (er *ConnectRes) WriteTo(w io.Writer) (int64, error)

type ImportCarReq

type ImportCarReq struct {
	// The path to the CAR file
	Path string `json:"path"`
	// The optional key associated to the CAR. If not provided, one will be generated.
	Key []byte `json:"key"`
	// The optional metadata.
	Metadata stiapi.Metadata `json:"metadata"`
}

ImportCarReq represents a request for importing a CAR file.

func (*ImportCarReq) ReadFrom

func (er *ImportCarReq) ReadFrom(r io.Reader) (int64, error)

func (*ImportCarReq) WriteTo

func (er *ImportCarReq) WriteTo(w io.Writer) (int64, error)

type ImportCarRes

type ImportCarRes struct {
	// The lookup Key associated to the imported CAR.
	Key []byte `json:"key"`
	// The CID of the advertisement generated as a result of import.
	AdvId cid.Cid `json:"adv_id"`
}

ImportCarRes represents the response to an ImportCarReq.

func (*ImportCarRes) ReadFrom

func (er *ImportCarRes) ReadFrom(r io.Reader) (int64, error)

func (*ImportCarRes) WriteTo

func (er *ImportCarRes) WriteTo(w io.Writer) (int64, error)

type RemoveCarReq

type RemoveCarReq struct {
	// The key associated to the CAR.
	Key []byte `json:"key"`
}

RemoveCarReq represents a request for removing a CAR file.

func (*RemoveCarReq) ReadFrom

func (er *RemoveCarReq) ReadFrom(r io.Reader) (int64, error)

func (*RemoveCarReq) WriteTo

func (er *RemoveCarReq) WriteTo(w io.Writer) (int64, error)

type RemoveCarRes

type RemoveCarRes struct {
	// The CID of the advertisement generated as a result of removal.
	AdvId cid.Cid `json:"adv_id"`
}

RemoveCarRes represents the response to a RemoveCarReq

func (*RemoveCarRes) ReadFrom

func (er *RemoveCarRes) ReadFrom(r io.Reader) (int64, error)

func (*RemoveCarRes) WriteTo

func (er *RemoveCarRes) WriteTo(w io.Writer) (int64, error)

type Server

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

func New

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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