Documentation ¶
Index ¶
- type Client
- func (c *Client) AddFileNs(ctx context.Context, owner, priKey, ns, des string, replica int) error
- func (c *Client) ConfirmOrRejectAuth(ctx context.Context, opt ConfirmAuthOptions) error
- func (c *Client) GetAuth(ctx context.Context, authID string) (blockchain.FileAuthApplication, error)
- func (c *Client) GetChallengeByID(ctx context.Context, id string) (blockchain.Challenge, error)
- func (c *Client) GetChallenges(ctx context.Context, opt GetChallengesOptions, status string) ([]blockchain.Challenge, error)
- func (c *Client) GetFileByID(ctx context.Context, id string) (blockchain.FileH, error)
- func (c *Client) GetFileByName(ctx context.Context, owner, ns, name string) (blockchain.FileH, error)
- func (c *Client) GetFileSysHealth(ctx context.Context, owner string) (blockchain.FileSysHealth, error)
- func (c *Client) GetMigrateRecords(ctx context.Context, id string, start, end int64, limit int64) ([]map[string]interface{}, error)
- func (c *Client) GetNode(ctx context.Context, id string) (blockchain.Node, error)
- func (c *Client) GetNodeHealth(ctx context.Context, id string) (string, error)
- func (c *Client) GetNodeHeartbeat(ctx context.Context, id string, ctime int64) (map[string]int, error)
- func (c *Client) GetNsByName(ctx context.Context, owner, ns string) (blockchain.NamespaceH, error)
- func (c *Client) ListFileAuths(ctx context.Context, opt ListFileAuthOptions) (blockchain.FileAuthApplications, error)
- func (c *Client) ListFileNs(ctx context.Context, opt ListNsOptions) ([]blockchain.Namespace, error)
- func (c *Client) ListFiles(ctx context.Context, opt ListFileOptions, isExpired bool) ([]blockchain.File, error)
- func (c *Client) ListNodes(ctx context.Context) (blockchain.Nodes, error)
- func (c *Client) NodeOffline(ctx context.Context, privkey string) error
- func (c *Client) NodeOnline(ctx context.Context, privkey string) error
- func (c *Client) Read(ctx context.Context, opt ReadOptions) (io.ReadCloser, error)
- func (c *Client) UpdateExpTimeByID(ctx context.Context, id, privateKey string, expireTime int64) error
- func (c *Client) UpdateFileNsReplica(ctx context.Context, priKey, ns string, replica int) error
- func (c *Client) Write(ctx context.Context, r io.Reader, opt WriteOptions) (servertypes.WriteResponse, error)
- type ConfirmAuthOptions
- type GetChallengesOptions
- type ListFileAuthOptions
- type ListFileOptions
- type ListNsOptions
- type ReadOptions
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ConfirmOrRejectAuth ¶
func (c *Client) ConfirmOrRejectAuth(ctx context.Context, opt ConfirmAuthOptions) error
ConfirmOrRejectAuth confirm or reject applier's file authorization application by opt.Status
func (*Client) GetAuth ¶
func (c *Client) GetAuth(ctx context.Context, authID string) (blockchain.FileAuthApplication, error)
GetAuth get file authorization application detail by authID
func (*Client) GetChallengeByID ¶
GetChallengeByID get challenge info by challenge id
func (*Client) GetChallenges ¶
func (c *Client) GetChallenges(ctx context.Context, opt GetChallengesOptions, status string) ([]blockchain.Challenge, error)
GetChallenges get challenges with status "ToProve" or "Proved" or "Failed"
func (*Client) GetFileByID ¶
GetFileByID get file info by file id
func (*Client) GetFileByName ¶
func (c *Client) GetFileByName(ctx context.Context, owner, ns, name string) (blockchain.FileH, error)
GetFileByName get file info by file name, owner and namespace
func (*Client) GetFileSysHealth ¶
func (c *Client) GetFileSysHealth(ctx context.Context, owner string) (blockchain.FileSysHealth, error)
GetFileSysHealth get system health status of an owner
func (*Client) GetMigrateRecords ¶
func (c *Client) GetMigrateRecords(ctx context.Context, id string, start, end int64, limit int64) ([]map[string]interface{}, error)
GetMigrateRecords get storage node migrate records
func (*Client) GetNodeHealth ¶
GetNodeHealth get storage node health status by node id
func (*Client) GetNodeHeartbeat ¶
func (c *Client) GetNodeHeartbeat(ctx context.Context, id string, ctime int64) (map[string]int, error)
GetNodeHeartbeat get storage node heart beat number
func (*Client) GetNsByName ¶
func (c *Client) GetNsByName(ctx context.Context, owner, ns string) (blockchain.NamespaceH, error)
GetNsByName get namespace by name and owner
func (*Client) ListFileAuths ¶
func (c *Client) ListFileAuths(ctx context.Context, opt ListFileAuthOptions) (blockchain.FileAuthApplications, error)
ListFileAuths get the list of file authorization applications
func (*Client) ListFileNs ¶
func (c *Client) ListFileNs(ctx context.Context, opt ListNsOptions) ([]blockchain.Namespace, error)
ListFileNs list file namespaces
func (*Client) ListFiles ¶
func (c *Client) ListFiles(ctx context.Context, opt ListFileOptions, isExpired bool) ([]blockchain.File, error)
ListFiles list unexpired files
func (*Client) NodeOffline ¶
NodeOffline set storage node status offline
func (*Client) NodeOnline ¶
NodeOnline set storage node status online
func (*Client) Read ¶
func (c *Client) Read(ctx context.Context, opt ReadOptions) (io.ReadCloser, error)
Read download a file
func (*Client) UpdateExpTimeByID ¶
func (c *Client) UpdateExpTimeByID(ctx context.Context, id, privateKey string, expireTime int64) error
UpdateExpTimeByID update file expire time by file id
func (*Client) UpdateFileNsReplica ¶
UpdateFileNsReplica update namespace replica
func (*Client) Write ¶
func (c *Client) Write(ctx context.Context, r io.Reader, opt WriteOptions) ( servertypes.WriteResponse, error)
Write upload a file
type ConfirmAuthOptions ¶
type ConfirmAuthOptions struct { PrivateKey string AuthID string ExpireTime int64 RejectReason string Status bool }
ConfirmAuthOptions define parameters for authorizers to confirm the file authorization application
type GetChallengesOptions ¶
type GetChallengesOptions struct { Owner string TargetNode string FileID string // optional, filter TimeStart int64 TimeEnd int64 Limit int64 }
GetChallengesOptions support paging query
type ListFileAuthOptions ¶
type ListFileAuthOptions struct { Owner string Applier string FileID string Status string TimeStart int64 TimeEnd int64 Limit int64 }
ListFileAuthOptions define parameters for authorizers or appliers to query the list of file authorization application
type ListFileOptions ¶
type ListFileOptions struct { Owner string Namespace string TimeStart int64 TimeEnd int64 Limit int64 }
ListFileOptions support paging query
type ListNsOptions ¶
ListNsOptions support paging query
type ReadOptions ¶
ReadOptions download files using FileID or Namespace+FileName