rpc

package
v0.0.0-...-9021772 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAPI

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

AuthAPI 权限插件

func NewAuthAPI

func NewAuthAPI(token string) *AuthAPI

NewAuthAPI 创建一个Auth API

func (*AuthAPI) GetRequestMetadata

func (a *AuthAPI) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (*AuthAPI) RequireTransportSecurity

func (a *AuthAPI) RequireTransportSecurity() bool

type Factory

type Factory interface {
	// SyncClient 创建一个文件同步客户端,使用完成之后不要忘记执行 Close 关闭连接
	SyncClient(endpoint string, token string) (FileSyncClient, error)
}

Factory RPC 客户端创建工厂

func NewFactory

func NewFactory() Factory

NewFactory 创建一个客户端创建工厂

type FileSyncClient

type FileSyncClient interface {
	// SyncMeta 同步文件元数据
	SyncMeta(fileToSync meta.File) ([]*protocol.File, error)
	// SyncDiff 同步文件比较,用于获取本次要同步的文件
	SyncDiff(files []*protocol.File, savePath func(f *protocol.File) string, syncOwner bool) (meta.FileNeedSyncs, error)
	// SyncFiles 同步文件
	SyncFiles(fileNeedSyncs meta.FileNeedSyncs, stage *collector.Stage) error
	// RelayInfo 检查上游是否有变更
	RelayInfo(names []string) ([]*protocol.RelayFile, error)
	// Close close GRPC connection
	Close()
}

FileSyncClient 文件同步客户端接口

func NewFileSyncClient

func NewFileSyncClient(client protocol.SyncServiceClient, closeFn func()) FileSyncClient

NewFileSyncClient 创建一个文件同步客户端

type ServiceProvider

type ServiceProvider struct{}

func (*ServiceProvider) Boot

func (s *ServiceProvider) Boot(app *glacier.Glacier)

func (*ServiceProvider) Register

func (s *ServiceProvider) Register(app *container.Container)

Jump to

Keyboard shortcuts

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