sea

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionUserDelete  uint = 1
	ActionUserShared  uint = 2
	ActionGroupDelete uint = 3
	ActionGroupShared uint = 4
)

Functions

This section is empty.

Types

type Operation

type Operation struct {
	Action uint   // delete or shared
	Owner  string // owner public key
	Hash   string // the hash of file or fragment
	Shared bool   // whether target is shared file or owner file
}

func NewOperation

func NewOperation(action uint, owner string, hash string, shared bool) *Operation

func OperationFromBytes

func OperationFromBytes(data []byte) (Operation, error)

func (Operation) ToBytes

func (o Operation) ToBytes() []byte

type Sea

type Sea struct {
	PublicKey  string
	Handles    int
	Operations []Operation
}

func NewSea

func NewSea(publicKey string) *Sea

func SeaFromBytes

func SeaFromBytes(data []byte) (*Sea, error)

func (*Sea) AddOperation

func (s *Sea) AddOperation(operations []*Operation)

func (*Sea) RemoveOperations

func (s *Sea) RemoveOperations(operations []Operation)

func (*Sea) ToBytes

func (s *Sea) ToBytes() []byte

Jump to

Keyboard shortcuts

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