common

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func CodeBlock

func CodeBlock(in string) string

func GetPluginURL

func GetPluginURL(client *pluginapi.Client) string

GetPluginURL returns a url like siteURL/plugins/pluginID based on the information from the client. If any error happens in the process, a empty string is returned.

func JSON

func JSON(ref interface{}) string

func JSONBlock

func JSONBlock(ref interface{}) string

func SlackAttachmentError

func SlackAttachmentError(w http.ResponseWriter, errorMessage string)

Types

type KVStore

type KVStore interface {
	Set(key string, value interface{}, options ...pluginapi.KVSetOption) (bool, error)
	SetWithExpiry(key string, value interface{}, ttl time.Duration) error
	CompareAndSet(key string, oldValue, value interface{}) (bool, error)
	CompareAndDelete(key string, oldValue interface{}) (bool, error)
	Get(key string, o interface{}) error
	Delete(key string) error
	DeleteAll() error
	ListKeys(page, count int, options ...pluginapi.ListKeysOption) ([]string, error)
}

Jump to

Keyboard shortcuts

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