manager

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CACHE_FILE_SYSTEM = "filesystem"
)

Variables

View Source
var NotFound = errors.New("wallet not found")

Functions

func AwaitTime

func AwaitTime(seconds int, f func() bool) error

func DebugSaveJson

func DebugSaveJson(filename string, data interface{}) error

func GetCallerFunctionName

func GetCallerFunctionName() string

func GetCurrentFunctionName

func GetCurrentFunctionName() string

Types

type Account

type Account struct {
	Address   string `json:"address"`
	PublicKey string `json:"publicKey"`
	NeoFS     struct {
		Balance   int64  `json:"balance"`
		Precision uint32 `json:"precision"`
	} `json:"neofs"`
	Nep17 map[string]wallet.Nep17Tokens `json:"nep17"'`
}

type Container

type Container struct {
	ID   string
	Size uint64
}

type Element

type Element struct {
	ID             string `json:"id"`
	Type           string `josn:"type"`
	Size           uint64 `json:"size"`
	BasicAcl       acl.Basic
	ExtendedAcl    eacl.Table
	Attributes     map[string]string `json:"attributes""`
	Errors         []error           `json:"errors",omitempty`
	ParentID       string
	Children       []Element `json:"children",omitempty`
	PendingDeleted bool
}

type HTTPClientError

type HTTPClientError struct {
	Code    int    `json:"code" example:"400"`
	Message string `json:"message" example:"status bad request"`
}

HTTPClientError returned when a client error occurs

type HTTPServerError

type HTTPServerError struct {
	Code    int    `json:"code" example:"502"`
	Message string `json:"message" example:"status server error"`
}

HTTPServerError returned when a server error occurs

type Manager

type Manager struct {
	DEBUG bool
	// contains filtered or unexported fields
}

func NewFileSystemManager

func NewFileSystemManager(version string, dbLocation string, DEBUG bool) (*Manager, error)

func (*Manager) AddContact

func (m *Manager) AddContact(firstName, lastName, walletAddress, publicKey string) ([]contact, error)

func (*Manager) AddSharedContainer

func (m *Manager) AddSharedContainer(containerID string) error

func (*Manager) CancelObjectContext added in v0.5.7

func (m *Manager) CancelObjectContext()

func (*Manager) ContainersChanged

func (m *Manager) ContainersChanged()

func (Manager) CopyToClipboard

func (m Manager) CopyToClipboard(txt string) error

func (*Manager) CreateContainer

func (m *Manager) CreateContainer(name string, permission string, block bool) error

func (*Manager) DeleteContact

func (m *Manager) DeleteContact(walletAddress string) ([]contact, error)

func (*Manager) DeleteContainer

func (m *Manager) DeleteContainer(id string) ([]Element, error)

DeleteContainer must mark the container in the cache as deleted and delete it from neoFS

func (*Manager) DeleteObject

func (m *Manager) DeleteObject(objectID, containerID string) ([]Element, error)

func (*Manager) DeleteRecentWallet

func (m *Manager) DeleteRecentWallet(walletId string) error

func (*Manager) DomReady

func (m *Manager) DomReady(ctx context.Context)

domReady is called after the front-end dom has been loaded

func (*Manager) Download

func (m *Manager) Download(filename, objectID, containerID string) error

Upload will put an object in NeoFS. You can access publically available files at https://http.testnet.fs.neo.org/<containerID>/<objectID>

func (*Manager) EnableCache

func (m *Manager) EnableCache(enable bool) error

func (*Manager) EnableLocalServer

func (m *Manager) EnableLocalServer(enable bool)

func (*Manager) ForceSync

func (m *Manager) ForceSync()

func (*Manager) Get

func (m *Manager) Get(objectID, containerID, fp string, writer io.Writer) ([]byte, error)

func (*Manager) GetAccountInformation

func (m *Manager) GetAccountInformation() (Account, error)

func (*Manager) GetObjectMetaData

func (m *Manager) GetObjectMetaData(objectID, containerID string) (object.Object, error)

GetObjectMetaData is live not cached

func (*Manager) GetVersion

func (m *Manager) GetVersion() string

func (*Manager) ListContainerIDs

func (m *Manager) ListContainerIDs() ([]string, error)

func (*Manager) ListContainerObjects

func (m *Manager) ListContainerObjects(containerID string, synchronised, deleted bool) ([]Element, error)

ListContainerObjects ets from cache

func (*Manager) ListContainers

func (m *Manager) ListContainers(synchronised, deleted bool) ([]Element, error)

ListContainers populates from cache

func (*Manager) ListSharedContainerObjects

func (m *Manager) ListSharedContainerObjects(containerID string, synchronised bool) ([]Element, error)

ListSharedContainerObjects ets from cache

func (*Manager) ListSharedContainers

func (m *Manager) ListSharedContainers() ([]Element, error)

func (*Manager) LoadWallet

func (m *Manager) LoadWallet(password string) error

func (*Manager) LoadWalletWithPath

func (m *Manager) LoadWalletWithPath(password, filepath string) error

func (*Manager) LoadWalletWithoutPassword

func (m *Manager) LoadWalletWithoutPassword() (string, error)

firstly call this to get a filepath then once the filepath is returned to the frontend, call the modal to get a password then finally from the frontend call return m.LoadWalletWithPath(password, filepath) wallet loaded.

func (*Manager) LockWallet

func (m *Manager) LockWallet()

func (*Manager) MakeNotification

func (m *Manager) MakeNotification(message NotificationMessage)

func (*Manager) MakeToast

func (m *Manager) MakeToast(message UXMessage)

func (Manager) MarkAllNotificationsRead

func (m Manager) MarkAllNotificationsRead() error

func (Manager) MarkNotificationRead

func (m Manager) MarkNotificationRead(uuid string) error

func (*Manager) NetworkChangeNotification

func (m *Manager) NetworkChangeNotification()

func (*Manager) NewListReadOnlyContainerContents

func (m *Manager) NewListReadOnlyContainerContents(since int64) ([]Element, error)

NewListReadOnlyContainerContents lists from cache

func (*Manager) NewWallet

func (m *Manager) NewWallet(password, filepath string) error

func (*Manager) NewWalletFromWIF

func (m *Manager) NewWalletFromWIF(password, wif, filepath string) error

func (Manager) Notifications

func (m Manager) Notifications() ([]NotificationMessage, error)

func (Manager) OpenInDefaultBrowser

func (m Manager) OpenInDefaultBrowser(txt string) error

func (*Manager) Pool

func (m *Manager) Pool(forceRenew bool) (*pool.Pool, error)

todo we will want to have things dependent on the wallet controlled elsewhere with singletons and no other way of getting the value todo remove the need to pass the private key to the api (usually for getOwnerID - however this should be passed into the backend

func (*Manager) RecentWallets

func (m *Manager) RecentWallets() (map[string]cleanedWallet, error)

func (*Manager) RemoveSharedContainer

func (m *Manager) RemoveSharedContainer(containerId string) ([]Element, error)

func (*Manager) RestrictContainer

func (m *Manager) RestrictContainer(id string, publicKey string) error

func (*Manager) RetrieveContactByWalletAddress

func (m *Manager) RetrieveContactByWalletAddress(walletAddress string) (contact, error)

func (*Manager) RetrieveContacts

func (m *Manager) RetrieveContacts() ([]contact, error)

func (*Manager) RetrieveWIF

func (m *Manager) RetrieveWIF() (string, error)

func (*Manager) SaveWalletWithoutPassword

func (m *Manager) SaveWalletWithoutPassword() (string, error)

firstly call this to get a filepath then once the filepath is returned to the frontend, call the modal to get a password then finally from the frontend call return m.LoadWalletWithPath(password, filepath) wallet loaded.

func (*Manager) SendSignal

func (m *Manager) SendSignal(signalName string, signalValue interface{})

func (*Manager) SetProgressPercentage

func (m *Manager) SetProgressPercentage(progressMessage ProgressMessage)

func (*Manager) SetSelectedNetwork

func (m *Manager) SetSelectedNetwork(network string) (NetworkData, error)

return the network addresses for the selected network

func (*Manager) SetWalletDebugging

func (m *Manager) SetWalletDebugging(walletPath, password string) error

func (*Manager) SetupServer

func (m *Manager) SetupServer(ctx context.Context) error

func (*Manager) Shutdown

func (m *Manager) Shutdown(ctx context.Context)

shutdown is called at application termination

func (*Manager) Startup

func (m *Manager) Startup(ctx context.Context)

startup is called at application startup

func (*Manager) TopUpNeoWallet

func (m *Manager) TopUpNeoWallet(amount float64) (string, error)

todo - terrible name if this is to topup NeoFS Gas

func (*Manager) TransferToken

func (m *Manager) TransferToken(recipient string, amount float64) (string, error)

func (*Manager) UnlockWallet

func (m *Manager) UnlockWallet() error

func (*Manager) Upload

func (m *Manager) Upload(containerID string, attributes map[string]string) ([]Element, error)

Upload will put an object in NeoFS. You can access publically available files at https://http.testnet.fs.neo.org/<containerID>/<objectID>

func (*Manager) UploadObject

func (m *Manager) UploadObject(containerID, fp string, filtered map[string]string) ([]Element, error)

type Mimes

type Mimes struct {
	MimeType  string `json:"mimeType"`
	Extension string `json:"Extension"`
}

type Network

type Network string

type NetworkData

type NetworkData struct {
	Name         string
	ID           string
	Address      string
	SidechainRPC []string
	StorageNodes map[string]config.Peer
	RpcNodes     []string
}

type NodeSelection added in v0.5.7

type NodeSelection struct {
	Nodes []config.Peer
	// contains filtered or unexported fields
}

func NewNetworkSelector added in v0.5.7

func NewNetworkSelector(nodes []config.Peer) NodeSelection

type NotificationMessage

type NotificationMessage struct {
	Id          string
	User        string //who is this message for so we can store it in the database
	Title       string
	Type        string
	Action      string
	Description string
	Meta        map[string]string
	CreatedAt   string
	MarkRead    bool
}

func NewNotificationMessage

func NewNotificationMessage(p *NotificationMessage) NotificationMessage

type ProgressMessage

type ProgressMessage struct {
	Id       int
	Title    string
	Progress int
	Show     bool
	Error    string
}

func NewProgressMessage

func NewProgressMessage(p *ProgressMessage) ProgressMessage

type TmpObjectMeta

type TmpObjectMeta struct {
	Size    uint64
	Objects []Element
}

type UXMessage

type UXMessage struct {
	Id          int
	Title       string
	Type        string
	Description string
	Closure     bool
}

func NewToastMessage

func NewToastMessage(t *UXMessage) UXMessage

Jump to

Keyboard shortcuts

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