common

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 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 DialogError added in v0.0.23

func DialogError(w http.ResponseWriter, err error)

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, err error)

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)
}

type LogAPI added in v0.0.12

type LogAPI interface {
	LogError(message string, keyValuePairs ...interface{})
	LogWarn(message string, keyValuePairs ...interface{})
	LogInfo(message string, keyValuePairs ...interface{})
	LogDebug(message string, keyValuePairs ...interface{})
}

Jump to

Keyboard shortcuts

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