rest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeData

func DecodeData(data string) ([]byte, error)

func DecodeID

func DecodeID(id string) (string, error)

func EncodeData

func EncodeData(data []byte) string

func EncodeID

func EncodeID(id string) string

func HandleError

func HandleError(s *client.Schemas, t func(http.ResponseWriter, *http.Request) error) http.Handler

func New

func New() types.Frontend

func NewRouter

func NewRouter(s *Server) *mux.Router

func NewSchema

func NewSchema() *client.Schemas

Types

type Device

type Device struct {
	Name       string
	Size       int64
	SectorSize int64
	// contains filtered or unexported fields
}

func (*Device) Endpoint added in v0.3.0

func (d *Device) Endpoint() string

func (*Device) FrontendName added in v0.3.0

func (d *Device) FrontendName() string

func (*Device) Shutdown

func (d *Device) Shutdown() error

func (*Device) Startup added in v0.3.0

func (d *Device) Startup(name string, size, sectorSize int64, rw types.ReaderWriterAt) error

func (*Device) State added in v0.3.0

func (d *Device) State() types.State

type ReadInput

type ReadInput struct {
	client.Resource
	Offset int64 `json:"offset,string"`
	Length int64 `json:"length,string"`
}

type ReadOutput

type ReadOutput struct {
	client.Resource
	Data string `json:"data"`
}

type Server

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

func NewServer

func NewServer(d *Device) *Server

func (*Server) GetVolume

func (s *Server) GetVolume(rw http.ResponseWriter, req *http.Request) error

func (*Server) ListVolumes

func (s *Server) ListVolumes(rw http.ResponseWriter, req *http.Request) error

func (*Server) ReadAt

func (s *Server) ReadAt(rw http.ResponseWriter, req *http.Request) error

func (*Server) WriteAt

func (s *Server) WriteAt(rw http.ResponseWriter, req *http.Request) error

type Volume

type Volume struct {
	client.Resource
	Name string `json:"name"`
}

func NewVolume

func NewVolume(context *api.ApiContext, name string) *Volume

type WriteInput

type WriteInput struct {
	client.Resource
	Offset int64  `json:"offset"`
	Length int    `json:"length"`
	Data   string `json:"data"`
}

type WriteOutput

type WriteOutput struct {
	client.Resource
}

Jump to

Keyboard shortcuts

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