properties

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package properties implements a layer on top of the scoped store. It combineds a store for each scope as a single store, and allows the stores to be search either as one, or individually.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PropertyStore

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

PropertyStore is used to store key values pairs that are dependent on a scope

func NewPropertyStore

func NewPropertyStore(s storage.Storer, m *hugot.Message) PropertyStore

NewPropertyStore uese the provided store to store properties, under a prefix pfx

func (PropertyStore) Get

func (ps PropertyStore) Get(k []string) (string, bool, error)

Get looks up a property. Scopes are searched in the following order:

ChanneUser
User
Channel
Global

func (PropertyStore) GetInScope

func (ps PropertyStore) GetInScope(s scope.Scope, k []string) (string, bool, error)

GetInScope looks up the property for the given message, in the reuested scope

func (PropertyStore) LookupAll

func (ps PropertyStore) LookupAll(k []string) (map[scope.Scope]string, error)

LookupAll searches all scopes for property k

func (PropertyStore) Set

func (ps PropertyStore) Set(s scope.Scope, k []string, v string) error

Set sets a property for the given scope, using the channel and and user details in the message provided in Message

func (PropertyStore) Unset

func (ps PropertyStore) Unset(s scope.Scope, k []string) error

Unset sets a property in a given scope, using the channel and and user details in the message provided in Message

Jump to

Keyboard shortcuts

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