config

package
v0.0.0-...-b215688 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	PluginID       string
	PluginVersion  string
	BuildDate      string
	BuildHash      string
	BuildHashShort string
}

type Config

type Config struct {
	*StoredConfig
	*BuildConfig

	BotUserID              string
	MattermostSiteHostname string
	MattermostSiteURL      string
	PluginURL              string
	PluginURLPath          string
}

Config represents the the metadata handed to all request runners (command, http).

type Mapper

type Mapper interface {
	Map(onto map[string]interface{}) (result map[string]interface{})
}

type Service

type Service interface {
	Get() *Config
	Refresh() error
	Store(*StoredConfig)
}

func NewService

func NewService(build *BuildConfig, store Store) Service

func NewTestService

func NewTestService(config *Config) Service

type Store

type Store interface {
	SaveConfig(conf Mapper)
	GetConfig(ref interface{}) error
	GetMattermostConfig() *model.Config
	GetBotUserID() string
}

type StoredConfig

type StoredConfig struct {
	bot.BotConfig
}

StoredConfig represents the data stored in and managed with the Mattermost config.

func (StoredConfig) Map

func (c StoredConfig) Map(onto map[string]interface{}) map[string]interface{}

Jump to

Keyboard shortcuts

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