types

package
v0.0.0-...-ebe581b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MerkleChallengeAlgorithm  = "Merkle"
	PairingChallengeAlgorithm = "Pairing"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddNsOptions

type AddNsOptions struct {
	Namespace   string `json:"ns"`
	Description string `json:"desc"`
	Replica     int    `json:"replica"`
	CreateTime  int64  `json:"ctime"`
	User        string `json:"user"`
	Token       string `json:"-"`
}

AddNsOptions options for adding namespace on blockchain

func (*AddNsOptions) Valid

func (o *AddNsOptions) Valid() error

Valid checks if AddNsOptions is valid

type ConfirmAuthOptions

type ConfirmAuthOptions struct {
	User         string `json:"user"` // authorizer's public key
	AuthID       string `json:"authID"`
	RejectReason string `json:"rejectReason"`
	ExpireTime   int64  `json:"expireTime"`
	Status       bool   `json:"status"` // file authorization application status
	Token        string `json:"-"`
}

ConfirmAuthOptions parameters for authorizers confirm or reject file authorization application

func (*ConfirmAuthOptions) Valid

func (o *ConfirmAuthOptions) Valid(status bool) error

Valid checks if ConfirmAuthOptions is valid

type ListFileAuthOptions

type ListFileAuthOptions struct {
	Applier    string // applier's public key
	Authorizer string // authorizer's public key
	FileID     string
	Status     string // file authorization application status
	TimeStart  int64
	TimeEnd    int64
	Limit      int64
}

ListFileAuthOptions parameters for authorizers or appliers to query the list of file authorization applications

type ListFileOptions

type ListFileOptions struct {
	Owner     string // file owner
	Namespace string // file namespace

	TimeStart   int64 // time period
	TimeEnd     int64
	CurrentTime int64 // current time
	Limit       int64 // file limit
}

ListFileOptions options for listing files from blockchain

func (*ListFileOptions) Valid

func (o *ListFileOptions) Valid() error

Valid checks if ListFileOptions is valid

type ListNsOptions

type ListNsOptions ListFileOptions

type NodeOperateOptions

type NodeOperateOptions struct {
	NodeID string `json:"node"`
	Nonce  int64  `json:"nonce"`
	Token  string `json:"-"`
}

NodeOperateOptions options for setting storage node with online or offline status on blockchain

type PairingChallengeConf

type PairingChallengeConf struct {
	Privkey []byte
	Pubkey  []byte
	RandU   []byte
	RandV   []byte
}

PairingChallengeConf config of pairing based challenge

type PullOptions

type PullOptions struct {
	Pubkey    []byte `json:"pubkey"` // file owner public key or applier's public key, applier has usage requirements for files
	SliceID   string `json:"slice_id"`
	StorIndex string `json:"slice_stor_index"`
	FileID    string `json:"file_id"`
	Timestamp int64  `json:"timestamp"`
	NotASlice bool   `json:"notASlice"` // denote if pushed content is not a slice, current pairing based challenge sigmas is supported
	Signature string `json:"signature"`
}

PullOptions options for pulling slice from storage node

type PushOptions

type PushOptions struct {
	SliceID   string
	SourceID  string // dataOwner node id
	NotASlice bool   // denote if pushed content is not a slice, current pairing based challenge sigmas is supported
}

PushOptions options for pushing slice to storage node

type PushResponse

type PushResponse struct {
	SliceStorIndex string `json:"slice_stor_index"`
}

PushResponse is response of receiving a slice

SliceStorIndex is storage index of a slice

type ReadOptions

type ReadOptions struct {
	User      string `json:"user"`
	Timestamp int64  `json:"timestamp"`
	Namespace string `json:"ns"`
	FileName  string `json:"name"`
	FileID    string `json:"file_id"`
	Token     string `json:"-"`
}

ReadOptions read file from engine use user+namespace+filename or fileID to locate a file will use fileID first if not empty

func (*ReadOptions) Valid

func (r *ReadOptions) Valid() error

Valid check if ReadOptions is valid

type UpdateFileEtimeOptions

type UpdateFileEtimeOptions struct {
	FileID      string `json:"id"`
	ExpireTime  int64  `json:"expireTime"`
	CurrentTime int64  `json:"ctime"`
	User        string `json:"user"`
	Token       string `json:"-"`
}

UpdateFileEtimeOptions options for updating file expire time

func (*UpdateFileEtimeOptions) Valid

func (o *UpdateFileEtimeOptions) Valid() error

Valid checks if UpdateFileEtimeOptions is valid

type UpdateNsOptions

type UpdateNsOptions struct {
	Namespace   string `json:"ns"`
	Replica     int    `json:"replica"`
	CurrentTime int64  `json:"ctime"`
	User        string `json:"user"`
	Token       string `json:"-"`
}

UpdateNsOptions options for updating namespace replica

func (*UpdateNsOptions) Valid

func (o *UpdateNsOptions) Valid() error

Valid checks if WriteOptions is valid

type WriteOptions

type WriteOptions struct {
	User        string `json:"user"`
	Namespace   string `json:"ns"`
	FileName    string `json:"name"`
	ExpireTime  int64  `json:"expireTime"`
	Description string `json:"desc"`
	Extra       string `json:"ext"`
	Token       string `json:"-"`
}

WriteOptions options for writing file to system

func (*WriteOptions) Valid

func (o *WriteOptions) Valid() error

Valid checks if WriteOptions is valid

type WriteResponse

type WriteResponse struct {
	FileID string `json:"file_id"`
}

WriteResponse is response of uploading a file, only task id

Jump to

Keyboard shortcuts

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