Documentation ¶
Index ¶
- Constants
- Variables
- func APIEndpoint() string
- func AddOrMergeContext(context Context) error
- func BetteruptimeToken() string
- func Init()
- func Load() error
- func NewConfigFileContextManager(filename string) *configFileContextManager
- func Organisation() string
- func Save() error
- func SetCurrentContext(name string) error
- type API
- type APIs
- type Config
- type Context
- type ContextManager
- type ContextRef
- type ContextRefs
- type User
- type Users
Constants ¶
View Source
const (
DefaultConfigFilename = ".uptimectl.yaml"
)
Variables ¶
View Source
var (
ErrContextNotFound = errors.New("context not found")
)
View Source
var (
OrganisationFlag string
)
Functions ¶
func APIEndpoint ¶
func APIEndpoint() string
func AddOrMergeContext ¶
func BetteruptimeToken ¶
func BetteruptimeToken() string
func NewConfigFileContextManager ¶
func NewConfigFileContextManager(filename string) *configFileContextManager
func Organisation ¶
func Organisation() string
func SetCurrentContext ¶
Types ¶
type Config ¶
type Config struct { ConfigVersion string `yaml:"configVersion"` Contexts []ContextRefs `yaml:"contexts"` CurrentContext string `yaml:"current-context"` APIs []APIs `yaml:"apis"` Users []Users `yaml:"users"` }
type Context ¶
func CurrentContext ¶
func CurrentContext() Context
type ContextManager ¶
type ContextManager interface { CurrentContext() Context HasCurrentContext() bool SetCurrentContext(name string) error AddOrMergeContext(context Context) error RenameAPI(oldName, newName string) error RenameContext(oldName, newName string) error RenameUser(oldName, newName string) error Load() error Save() error Config() Config }
func GlobalContextManager ¶
func GlobalContextManager() ContextManager
type ContextRef ¶
type ContextRefs ¶
type ContextRefs struct { Name string `yaml:"name"` Context ContextRef `yaml:"context"` }
Click to show internal directories.
Click to hide internal directories.