Documentation ¶
Index ¶
- Constants
- type Core
- func (c *Core) AcquireNode(ctx context.Context, m *Model, sessionID string) error
- func (c *Core) CreateNode(ctx context.Context, m *Model) error
- func (c *Core) DeleteNode(ctx context.Context, m *Model) error
- func (c *Core) Exists(ctx context.Context, key string) (bool, error)
- func (c *Core) ExistsWithID(ctx context.Context, id string) (bool, error)
- func (c *Core) List(ctx context.Context, prefix string) ([]*Model, error)
- func (c *Core) ListKeys(ctx context.Context, prefix string) ([]string, error)
- type ICore
- type IRepo
- type Model
- type Repo
Constants ¶
View Source
const (
// Prefix for all node keys in the registry
Prefix = "nodes/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core implements all business logic for node
func (*Core) AcquireNode ¶
AcquireNode to create a node model with acquiring a lock on it
func (*Core) CreateNode ¶
CreateNode creates a new node
func (*Core) DeleteNode ¶
DeleteNode deletes a node and all resources in it
func (*Core) ExistsWithID ¶
ExistsWithID to check if the node exists with the ID
type ICore ¶
type ICore interface { CreateNode(ctx context.Context, m *Model) error Exists(ctx context.Context, key string) (bool, error) AcquireNode(ctx context.Context, m *Model, sessionID string) error ExistsWithID(ctx context.Context, id string) (bool, error) DeleteNode(ctx context.Context, m *Model) error ListKeys(ctx context.Context, prefix string) ([]string, error) List(ctx context.Context, prefix string) ([]*Model, error) }
ICore is an interface over node core
type IRepo ¶
type IRepo interface { common.IRepo List(ctx context.Context, prefix string) ([]common.IModel, error) }
IRepo interface over database repository
Click to show internal directories.
Click to hide internal directories.