config

package
v3.0.2+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PluginName                = "standup-raven"
	CommandPrefix             = "standup"
	ServerExeToWebappRootPath = "/../webapp"

	URLPluginBase = "/plugins/" + PluginName
	URLStaticBase = URLPluginBase + "/static"

	HeaderMattermostUserId = "Mattermost-User-Id"

	ReportFormatUserAggregated = "user_aggregated"
	ReportFormatTypeAggregated = "type_aggregated"

	CacheKeyPrefixNotificationStatus = "notif_status"
	CacheKeyPrefixTeamStandupConfig  = "standup_config_"

	CacheKeyAllStandupChannels = "all_standup_channels"

	WindowCloseNotificationDurationPercentage = 0.8 // 80%

	UserIconURL  = "/api/v4/users/%s/image"
	UserIconSize = "=20x20"

	// Ensure two full cycles can run in a under a minute
	// to handle the special case of 23:59 window close time.
	// If first cycle starts at 23:58:59, second at 23:59:xx1,
	// third will probably run at 00:00:xx2 causing no automated standup reports as
	// the date changed between 23:59 and 00:00:xx2.
	RunnerInterval = 25 * time.Second

	BotUsername     = "raven"
	BotDisplayName  = "Raven"
	OverrideIconURL = URLStaticBase + "/logo.png"
)

Variables

Functions

func SetConfig

func SetConfig(c *Configuration)

Types

type Configuration

type Configuration struct {
	TimeZone                string `json:"timeZone"`
	PermissionSchemaEnabled bool   `json:"permissionSchemaEnabled"`
	EnableErrorReporting    bool   `json:"enableErrorReporting"`
	PluginVersion           string `json:"plugin_version"`

	// derived attributes
	BotUserID       string         `json:"botUserId"`
	Location        *time.Location `json:"location"`
	SentryServerDSN string         `json:"sentryServerDSN"`
	SentryWebappDSN string         `json:"sentryWebappDSN"`
}

func GetConfig

func GetConfig() *Configuration

func (*Configuration) Clone

func (c *Configuration) Clone() *Configuration

func (*Configuration) ProcessConfiguration

func (c *Configuration) ProcessConfiguration() error

func (*Configuration) Sanitize

func (c *Configuration) Sanitize() *Configuration

func (*Configuration) ToJson

func (c *Configuration) ToJson() []byte

Jump to

Keyboard shortcuts

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