gsmconfig

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package gsmconfig is responsible for all functions pertaining to the configuration of GSM

Index

Constants

This section is empty.

Variables

View Source
var CfgDir string

CfgDir should be set to the directory containing all GSM configuration files

Functions

func CreateConfig

func CreateConfig(config *GSMConfig) (string, error)

CreateConfig creates a new config

func GetConfigPath

func GetConfigPath(name string) string

GetConfigPath returns the file path to a config file

func GetScopes

func GetScopes(name string) (string, error)

GetScopes returns the scopes of a config file so they can be easily added in the Admin Console

func LoadConfig

func LoadConfig(name string) error

LoadConfig sets the default config (.gsm.yaml) and renames the old one to <name>.yaml

func RemoveConfig

func RemoveConfig(name string) error

RemoveConfig removes a config

Types

type GSMConfig

type GSMConfig struct {
	Name            string   `yaml:"name,omitempty"`
	CredentialsFile string   `yaml:"credentialsFile,omitempty"`
	ServiceAccount  string   `yaml:"serviceAccount,omitempty"`
	Mode            string   `yaml:"mode,omitempty"`
	Subject         string   `yaml:"subject,omitempty"`
	LogFile         string   `yaml:"logFile,omitempty"`
	Scopes          []string `yaml:"scopes,omitempty"`
	Threads         int      `yaml:"threads,omitempty"`
	StandardDelay   int      `yaml:"standardDelay,omitempty"`
	Default         bool     `yaml:"default,omitempty"`
}

GSMConfig represents a GSM configuration

func GetConfig

func GetConfig(name string) (*GSMConfig, error)

GetConfig returns a single GSM config or an error

func ListConfigs

func ListConfigs() ([]*GSMConfig, error)

ListConfigs lists the config files in the config dir

func UpdateConfig added in v0.2.1

func UpdateConfig(config *GSMConfig, name string) (*GSMConfig, error)

UpdateConfig updates a new config

Jump to

Keyboard shortcuts

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