store

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package store implements the go-micro store interface

Package store implements the go-micro store interface

Package store implements the go-micro store interface

Package store implements the go-micro store interface

Index

Constants

This section is empty.

Variables

View Source
var (
	// Name is the default name for the settings store
	Name = "ocis-settings"
)

Functions

func New

func New(cfg *config.Config) settings.Manager

New creates a new store

Types

type Store

type Store struct {
	Logger olog.Logger
	// contains filtered or unexported fields
}

Store interacts with the filesystem to manage settings information

func (Store) AddSettingToBundle added in v0.2.0

func (s Store) AddSettingToBundle(bundleID string, setting *proto.Setting) (*proto.Setting, error)

AddSettingToBundle adds the given setting to the bundle with the given bundleID.

func (Store) ListBundles

func (s Store) ListBundles(bundleType proto.Bundle_Type) ([]*proto.Bundle, error)

ListBundles returns all bundles in the dataPath folder that match the given type.

func (Store) ListPermissionsByResource added in v0.3.0

func (s Store) ListPermissionsByResource(resource *proto.Resource, roleIDs []string) ([]*proto.Permission, error)

ListPermissionsByResource collects all permissions from the provided roleIDs that match the requested resource

func (Store) ListRoleAssignments added in v0.2.0

func (s Store) ListRoleAssignments(accountUUID string) ([]*proto.UserRoleAssignment, error)

ListRoleAssignments loads and returns all role assignments matching the given assignment identifier.

func (Store) ListValues

func (s Store) ListValues(bundleID, accountUUID string) ([]*proto.Value, error)

ListValues reads all values that match the given bundleId and accountUUID. If the bundleId is empty, it's ignored for filtering. If the accountUUID is empty, only values with empty accountUUID are returned. If the accountUUID is not empty, values with an empty or with a matching accountUUID are returned.

func (Store) ReadBundle

func (s Store) ReadBundle(bundleID string) (*proto.Bundle, error)

ReadBundle tries to find a bundle by the given id within the dataPath.

func (Store) ReadSetting added in v0.2.0

func (s Store) ReadSetting(settingID string) (*proto.Setting, error)

ReadSetting tries to find a setting by the given id within the dataPath.

func (Store) ReadValue

func (s Store) ReadValue(valueID string) (*proto.Value, error)

ReadValue tries to find a value by the given valueId within the dataPath

func (Store) ReadValueByUniqueIdentifiers added in v0.2.0

func (s Store) ReadValueByUniqueIdentifiers(accountUUID, settingID string) (*proto.Value, error)

ReadValueByUniqueIdentifiers tries to find a value given a set of unique identifiers

func (Store) RemoveRoleAssignment added in v0.2.0

func (s Store) RemoveRoleAssignment(assignmentID string) error

RemoveRoleAssignment deletes the given role assignment from the existing assignments of the respective account.

func (Store) RemoveSettingFromBundle added in v0.2.0

func (s Store) RemoveSettingFromBundle(bundleID string, settingID string) error

RemoveSettingFromBundle removes the setting from the bundle with the given ids.

func (Store) WriteBundle

func (s Store) WriteBundle(record *proto.Bundle) (*proto.Bundle, error)

WriteBundle writes the given record into a file within the dataPath.

func (Store) WriteRoleAssignment added in v0.2.0

func (s Store) WriteRoleAssignment(accountUUID, roleID string) (*proto.UserRoleAssignment, error)

WriteRoleAssignment appends the given role assignment to the existing assignments of the respective account.

func (Store) WriteValue

func (s Store) WriteValue(value *proto.Value) (*proto.Value, error)

WriteValue writes the given value into a file within the dataPath

Jump to

Keyboard shortcuts

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