gotnet

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type_RAW = StoreType(iota)
	Type_FS
	Type_VC
)
View Source
const (
	MaxMessageSize = gotfs.DefaultMaxBlobSize
)

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 cadata.ID   `json:"first,omitempty"`
	Limit int         `json:"limit,omitempty"`
}

type BlobResp

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

type BranchID

type BranchID struct {
	Peer PeerID
	Name string
}

type BranchInfo added in v0.0.3

type BranchInfo struct {
	Salt        []byte                `json:"salt"`
	Annotations []branches.Annotation `json:"annotations"`
	CreatedAt   tai64.TAI64           `json:"created_at"`
}

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[PeerID]
	Open  OpenFunc
}

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(ctx context.Context) error

type SpaceReq

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

type SpaceRes

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

type StoreID

type StoreID struct {
	Peer   PeerID
	Branch string
	Type   StoreType
}

type StoreType

type StoreType uint8

type WireError added in v0.0.3

type WireError struct {
	Code    codes.Code
	Message string
}

func (WireError) Error added in v0.0.3

func (e WireError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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