gotnet

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type_VC = StoreType(iota)
	Type_FS
	Type_RAW
)
View Source
const (
	MaxMessageSize = maxBlobSize
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobReq

type BlobReq struct {
	Op string `json:"op"`

	Branch    string    `json:"branch"`
	StoreType StoreType `json:"store_type"`

	IDs   []cadata.ID `json:"ids,omitempty"`
	First []byte      `json:"prefix,omitempty"`
	Limit int         `json:"limit,omitempty"`
}

type BlobResp

type BlobResp struct {
	Affected []bool      `json:"affected,omitempty"`
	IDs      []cadata.ID `json:"ids,omitempty"`
	EOL      bool        `json:"eol,omitempty"`
}

type BranchID

type BranchID struct {
	Peer PeerID
	Name string
}

type CASReq

type CASReq struct {
	Name string `json:"name"`
	Prev []byte `json:"prev"`
	Next []byte `json:"next"`
}

type CASRes

type CASRes struct {
	Actual []byte `json:"actual"`
}

type CellID

type CellID struct {
	Peer PeerID
	Name string
}

type CellReq

type CellReq struct {
	CAS  *CASReq  `json:"cas,omitempty"`
	Read *ReadReq `json:"read,omitempty"`
}

type OpenFunc

type OpenFunc = func(PeerID) branches.Space

OpenFunc is the type a function which returns a view of a Space based on a PeerID

type Params

type Params struct {
	Swarm  p2p.SecureAskSwarm
	Open   OpenFunc
	Logger *logrus.Logger
}

type PeerID

type PeerID = inet256.Addr

type ReadReq

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

type Service

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

func New

func New(params Params) *Service

func (*Service) GetSpace

func (s *Service) GetSpace(peer PeerID) branches.Space

func (*Service) Serve

func (s *Service) Serve() error

type SpaceReq

type SpaceReq struct {
	Op     string          `json:"op"`
	Name   string          `json:"name"`
	Limit  int             `json:"limit,omitempty"`
	Params branches.Params `json:"params,omitempty"`
}

type SpaceRes

type SpaceRes struct {
	Error  *string  `json:"error,omitempty"`
	Exists *bool    `json:"exists,omitempty"`
	Names  []string `json:"list,omitempty"`
}

type StoreID

type StoreID struct {
	Peer   PeerID
	Branch string
	Type   StoreType
}

type StoreType

type StoreType uint8

Jump to

Keyboard shortcuts

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