server

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	// The dataOwner node uses Write() and Read() to publish or download files
	Write(context.Context, etype.WriteOptions, io.Reader) (etype.WriteResponse, error)
	Read(context.Context, etype.ReadOptions) (io.ReadCloser, error)

	ListUnExpiredFiles(etype.ListFileOptions) ([]blockchain.File, error)
	ListExpiredFiles(etype.ListFileOptions) ([]blockchain.File, error)
	GetFileByID(ctx context.Context, id string) (blockchain.FileH, error)
	GetFileByName(ctx context.Context, pubkey, ns, name string) (blockchain.FileH, error)
	UpdateFileExpireTime(ctx context.Context, opt etype.UpdateFileEtimeOptions) error
	AddFileNs(opt etype.AddNsOptions) error
	UpdateNsReplica(ctx context.Context, opt etype.UpdateNsOptions) error
	ListFileNs(opt etype.ListNsOptions) ([]blockchain.Namespace, error)
	GetNsByName(ctx context.Context, pubkey, name string) (blockchain.NamespaceH, error)
	GetFileSysHealth(ctx context.Context, pubkey string) (blockchain.FileSysHealth, error)
	GetChallengeByID(id string) (blockchain.Challenge, error)
	GetChallenges(opt blockchain.ListChallengeOptions) ([]blockchain.Challenge, error)
	// The Storage node uses Push() or Pull() to store or provide ciphertext slices
	Push(etype.PushOptions, io.Reader) (etype.PushResponse, error)
	Pull(etype.PullOptions) (io.ReadCloser, error)
	// The dataOwner node uses the following methods to operate the applier's authorization request
	ListFileAuths(etype.ListFileAuthOptions) (blockchain.FileAuthApplications, error)
	ConfirmAuth(etype.ConfirmAuthOptions) error
	GetAuthByID(id string) (blockchain.FileAuthApplication, error)

	ListNodes() (blockchain.Nodes, error)
	GetNode([]byte) (blockchain.Node, error)
	GetHeartbeatNum([]byte, int64) (int, int, error)
	GetNodeHealth([]byte) (string, error)
	NodeOffline(etype.NodeOperateOptions) error
	NodeOnline(etype.NodeOperateOptions) error
	GetSliceMigrateRecords(opt *blockchain.NodeSliceMigrateOptions) (string, error)
}

Handler defines all apis exposed The handler under the engine implements the following methods

type Server

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

Server http server

func New

func New(listenAddress string, h Handler) (*Server, error)

New initiate Server

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

Serve runs and blocks current routine

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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