config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name        = "authms"
	VersionFull = "0.4.1" // Use http://semver.org standards
	Description = "Authentication Micro-Service"

	RPCNamePrefix = ""

	SMSAPITwilio         = "twilio"
	SMSAPIAfricasTalking = "africasTalking"
	SMSAPIMessageBird    = "messageBird"

	TimeFormat = time.RFC3339

	APIKeyLength = 56

	DocsPath = "docs"
)

Compile time constants that should not be configurable during runtime.

Variables

This section is empty.

Functions

func CanonicalName

func CanonicalName() string

func CanonicalRPCName

func CanonicalRPCName() string

func CanonicalWebName

func CanonicalWebName() string

func DefaultConfDir

func DefaultConfDir(newPSegments ...string) string

DefaultConfDir sets the value of the conf dir to use and returns it. It falls back to default - sysDConfDir() - if newPSegments has zero len.

func DefaultConfPath

func DefaultConfPath() string

func DefaultDocsDir

func DefaultDocsDir() string

func DefaultEmailInviteTpl

func DefaultEmailInviteTpl() string

func DefaultEmailResetPassTpl

func DefaultEmailResetPassTpl() string

func DefaultEmailVerifyTpl

func DefaultEmailVerifyTpl() string

func DefaultInstallDir

func DefaultInstallDir() string

func DefaultInstallPath

func DefaultInstallPath() string

func DefaultPhoneInviteTpl

func DefaultPhoneInviteTpl() string

func DefaultPhoneResetPassTpl

func DefaultPhoneResetPassTpl() string

func DefaultPhoneVerifyTpl

func DefaultPhoneVerifyTpl() string

func DefaultSysDUnitFilePath

func DefaultSysDUnitFilePath() string

func DefaultSysDUnitName

func DefaultSysDUnitName() string

func DefaultTplDir

func DefaultTplDir() string

func VersionMajorPrefixed

func VersionMajorPrefixed() string

func WebNamePrefix

func WebNamePrefix() string

func WebRootURL

func WebRootURL() string

Types

type AfricasTalking

type AfricasTalking struct {
	UserName   string `json:"username" yaml:"username"`
	APIKeyFile string `json:"apiKeyFile" yaml:"apiKeyFile"`
}

type Auth

type Auth struct {
	AllowSelfReg       bool          `json:"allowSelfReg" yaml:"allowSelfReg"`
	LockDevsToUsers    bool          `json:"lockDevsToUsers" yaml:"lockDevsToUsers"`
	Facebook           Facebook      `json:"facebook,omitempty" yaml:"facebook"`
	BlackListFailCount int           `json:"blackListFailCount" yaml:"blackListFailCount"`
	BlacklistWindow    time.Duration `json:"blacklistWindow" yaml:"blacklistWindow"`
}

type Facebook

type Facebook struct {
	SecretFilePath string `json:"secretFilePath,omitempty" yaml:"secretFilePath"`
	ID             int64  `json:"ID,omitempty" yaml:"ID"`
}

type General

type General struct {
	Service        Service     `json:"serviceConfig,omitempty" yaml:"serviceConfig"`
	Database       crdb.Config `json:"database,omitempty" yaml:"database"`
	Authentication Auth        `json:"authentication,omitempty" yaml:"authentication"`
	Token          JWT         `json:"token,omitempty" yaml:"token"`
	SMTP           SMTP        `json:"SMTP" yaml:"SMTP"`
	SMS            SMS         `json:"sms" yaml:"sms"`
}

func ReadFile

func ReadFile(fName string) (*General, error)

type JWT

type JWT struct {
	TokenKeyFile string `json:"tokenKeyFile" yaml:"tokenKeyFile"`
}

type MessageBird

type MessageBird struct {
	AccountName string `json:"accountName" yaml:"accountName"`
	APIKeyFile  string `json:"apiKeyFile" yaml:"apiKeyFile"`
}

type SMS

type SMS struct {
	TestNumber     string         `json:"testNumber" yaml:"testNumber"`
	ActiveAPI      string         `json:"activeAPI" yaml:"activeAPI"`
	Twilio         Twilio         `json:"twilio" yaml:"twilio"`
	AfricasTalking AfricasTalking `json:"africasTalking" yaml:"africasTalking"`
	MessageBird    MessageBird    `json:"messageBird" yaml:"messageBird"`
	InvitationTpl  string         `json:"invitationTpl,omitempty" yaml:"invitationTpl,omitempty"`
	ResetPWDTpl    string         `json:"resetPwdTpl,omitempty" yaml:"resetPwdTpl,omitempty"`
	VerifyTpl      string         `json:"verifyTpl,omitempty" yaml:"verifyTpl,omitempty"`
}

type SMTP

type SMTP struct {
	ServerAddress string `json:"serverAddress,omitempty" yaml:"serverAddress,omitempty"`
	TLSPort       int32  `json:"TLSPort,omitempty" yaml:"TLSPort,omitempty"`
	SSLPort       int32  `json:"SSLPort,omitempty" yaml:"SSLPort,omitempty"`
	Username      string `json:"username,omitempty" yaml:"username,omitempty"`
	PasswordFile  string `json:"passwordFile,omitempty" yaml:"passwordFile,omitempty"`
	FromEmail     string `json:"fromEmail,omitempty" yaml:"fromEmail,omitempty"`
	TestEmail     string `json:"testEmail" yaml:"testEmail"`
	CreatedAt     string `json:"createdAt,omitempty" yaml:"createdAt,omitempty"`
	UpdatedAt     string `json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"`
	InvitationTpl string `json:"invitationTpl,omitempty" yaml:"invitationTpl,omitempty"`
	ResetPWDTpl   string `json:"resetPwdTpl,omitempty" yaml:"resetPwdTpl,omitempty"`
	VerifyTpl     string `json:"verifyTpl,omitempty" yaml:"verifyTpl,omitempty"`
}

type Service

type Service struct {
	RegisterInterval   time.Duration `json:"registerInterval,omitempty" yaml:"registerInterval"`
	LoadBalanceVersion string        `json:"loadBalanceVersion,omitempty" yaml:"loadBalanceVersion"`
	MasterAPIKey       string        `json:"masterAPIKey,omitempty" yaml:"masterAPIKey"`
	AllowedOrigins     []string      `json:"allowedOrigins" yaml:"allowedOrigins"`
	AppName            string        `json:"appName" yaml:"appName"`
	WebAppURL          string        `json:"webAppURL" yaml:"webAppURL"`
	URL                string        `json:"URL" yaml:"URL"`
}

type Twilio

type Twilio struct {
	ID           string `json:"ID" yaml:"ID"`
	SenderPhone  string `json:"senderPhone" yaml:"senderPhone"`
	TokenKeyFile string `json:"tokenKeyFile" yaml:"tokenKeyFile"`
}

Jump to

Keyboard shortcuts

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