state

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: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Namespace      = crypto.SHA512HexFromBytes([]byte("SeaStorage"))[:6]
	UserNamespace  = crypto.SHA256HexFromBytes([]byte("User"))[:4]
	GroupNamespace = crypto.SHA256HexFromBytes([]byte("Group"))[:4]
	SeaNamespace   = crypto.SHA256HexFromBytes([]byte("Sea"))[:4]
)

Functions

func MakeAddress

func MakeAddress(addressType AddressType, name, publicKey string) string

Types

type AddressType

type AddressType uint8
var (
	AddressTypeUser  AddressType = 0
	AddressTypeGroup AddressType = 1
	AddressTypeSea   AddressType = 2
)

type SeaStorageState

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

func NewSeaStorageState

func NewSeaStorageState(context *processor.Context) *SeaStorageState

func (*SeaStorageState) CreateGroup

func (sss *SeaStorageState) CreateGroup(groupName, leader, key string) error

func (*SeaStorageState) CreateSea

func (sss *SeaStorageState) CreateSea(seaName, publicKey string) error

func (*SeaStorageState) CreateUser

func (sss *SeaStorageState) CreateUser(username string, publicKey string) error

func (*SeaStorageState) GetGroup

func (sss *SeaStorageState) GetGroup(address string) (*user.Group, error)

func (*SeaStorageState) GetSea

func (sss *SeaStorageState) GetSea(address string) (*sea.Sea, error)

func (*SeaStorageState) GetUser

func (sss *SeaStorageState) GetUser(address string) (*user.User, error)

func (*SeaStorageState) SeaConfirmOperations

func (sss *SeaStorageState) SeaConfirmOperations(seaName, publicKey string, operations []sea.Operation) error

func (*SeaStorageState) SeaStoreFile

func (sss *SeaStorageState) SeaStoreFile(seaName, publicKey string, operations []user.Operation) error

func (*SeaStorageState) UserCreateDirectory

func (sss *SeaStorageState) UserCreateDirectory(username, publicKey, p string) error

func (*SeaStorageState) UserCreateFile

func (sss *SeaStorageState) UserCreateFile(username, publicKey, p string, info storage.FileInfo) error

func (*SeaStorageState) UserDeleteDirectory

func (sss *SeaStorageState) UserDeleteDirectory(username, publicKey, p, target string) error

func (*SeaStorageState) UserDeleteFile

func (sss *SeaStorageState) UserDeleteFile(username, publicKey, p, target string) error

func (*SeaStorageState) UserMove

func (sss *SeaStorageState) UserMove(username, publicKey, p, name, newPath string) error

func (*SeaStorageState) UserPublishKey

func (sss *SeaStorageState) UserPublishKey(username, publicKey, keyIndex, key string) error

func (*SeaStorageState) UserShareFiles

func (sss *SeaStorageState) UserShareFiles(username, publicKey, p, target, dst string) error

func (*SeaStorageState) UserUpdateFileData

func (sss *SeaStorageState) UserUpdateFileData(username, publicKey, p string, info storage.FileInfo) error

func (*SeaStorageState) UserUpdateFileKey

func (sss *SeaStorageState) UserUpdateFileKey(username, publicKey, p string, info storage.FileInfo) error

func (*SeaStorageState) UserUpdateName

func (sss *SeaStorageState) UserUpdateName(username, publicKey, p, name, newName string) error

Jump to

Keyboard shortcuts

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