service

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package service

Package service manages the main logic of server.

Package service

Package service

Package service

Package service provides meta service

Package service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup

type Backup interface {
	Start(ctx context.Context) (<-chan error, error)
	GetObject(ctx context.Context, uuid string) (*payload.Backup_Vector, error)
	GetLocation(ctx context.Context, uuid string) ([]string, error)
	Register(ctx context.Context, vec *payload.Backup_Vector) error
	RegisterMultiple(ctx context.Context, vecs *payload.Backup_Vectors) error
	Remove(ctx context.Context, uuid string) error
	RemoveMultiple(ctx context.Context, uuids ...string) error
}

func NewBackup

func NewBackup(opts ...BackupOption) (bu Backup, err error)

type BackupOption

type BackupOption func(b *backup) error

func WithBackupClient

func WithBackupClient(client grpc.Client) BackupOption

type Filter

type Filter interface {
	Start(ctx context.Context) (<-chan error, error)
	FilterSearch(context.Context, *payload.Search_Response) (*payload.Search_Response, error)
}

func NewFilter

func NewFilter(opts ...FilterOption) (ef Filter, err error)

type FilterOption

type FilterOption func(f *filter) error

func WithFilterClient

func WithFilterClient(client grpc.Client) FilterOption

type GWOption

type GWOption func(g *gateway) error

func WithDiscoverer added in v0.0.9

func WithDiscoverer(c discoverer.Client) GWOption

func WithErrGroup

func WithErrGroup(eg errgroup.Group) GWOption

type Gateway

type Gateway interface {
	Start(ctx context.Context) (<-chan error, error)
	GetAgentCount(ctx context.Context) int
	Do(ctx context.Context,
		f func(ctx context.Context, tgt string, vc vald.Client, copts ...grpc.CallOption) error) error
	DoMulti(ctx context.Context, num int,
		f func(ctx context.Context, tgt string, vc vald.Client, copts ...grpc.CallOption) error) error
	BroadCast(ctx context.Context,
		f func(ctx context.Context, tgt string, vc vald.Client, copts ...grpc.CallOption) error) error
}

func NewGateway

func NewGateway(opts ...GWOption) (gw Gateway, err error)

type Meta

type Meta interface {
	Start(ctx context.Context) (<-chan error, error)
	Exists(context.Context, string) (bool, error)
	GetMeta(context.Context, string) (string, error)
	GetMetas(context.Context, ...string) ([]string, error)
	GetUUID(context.Context, string) (string, error)
	GetUUIDs(context.Context, ...string) ([]string, error)
	SetUUIDandMeta(context.Context, string, string) error
	SetUUIDandMetas(context.Context, map[string]string) error
	DeleteMeta(context.Context, string) (string, error)
	DeleteMetas(context.Context, ...string) ([]string, error)
	DeleteUUID(context.Context, string) (string, error)
	DeleteUUIDs(context.Context, ...string) ([]string, error)
}

func NewMeta

func NewMeta(opts ...MetaOption) (mi Meta, err error)

type MetaOption

type MetaOption func(m *meta) error

func WithMetaCache added in v0.0.2

func WithMetaCache(c cache.Cache) MetaOption

func WithMetaCacheEnabled added in v0.0.2

func WithMetaCacheEnabled(flg bool) MetaOption

func WithMetaCacheExpireDuration added in v0.0.2

func WithMetaCacheExpireDuration(dur string) MetaOption

func WithMetaCacheExpiredCheckDuration added in v0.0.2

func WithMetaCacheExpiredCheckDuration(dur string) MetaOption

func WithMetaClient

func WithMetaClient(client grpc.Client) MetaOption

Jump to

Keyboard shortcuts

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