resourcemanager

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 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 Manager

type Manager interface {
	// PutResource registers or updates a resource into the manager.
	PutResource(ctx context.Context, res c2smodel.ResourceDesc) error

	// GetResource returns a previously registered resource.
	GetResource(ctx context.Context, username, resource string) (c2smodel.ResourceDesc, error)

	// GetResources returns all user registered resources.
	GetResources(_ context.Context, username string) ([]c2smodel.ResourceDesc, error)

	// DelResource removes a registered resource from the manager.
	DelResource(ctx context.Context, username, resource string) error

	// Start starts resource manager.
	Start(ctx context.Context) error

	// Stop stops resource manager.
	Stop(ctx context.Context) error
}

Manager defines generic resource manager interface.

func NewKVManager

func NewKVManager(kv kv.KV, hk *hook.Hooks, logger kitlog.Logger) Manager

NewKVManager creates a new resource manager given a KV storage instance.

Jump to

Keyboard shortcuts

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