config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: MIT, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigurations

func LoadConfigurations(jsonFilePath string) error

LoadConfigurations load configurations from json file

Types

type Configuration

type Configuration struct {
	Runtime       *Runtime
	SmsGateway    *SmsGateway
	PDUConfigs    *PDUConfigs
	Database      *Database
	WebServer     *WebServer
	SMSSenderAuth *SMSSenderAuth
}

Configuration store all configuration

func GetConfigurations

func GetConfigurations() *Configuration

GetConfigurations get current system configuration

type Database

type Database struct {
	Driver                  string
	DSN                     string
	MaxIdleConn             int
	MaxOpenConn             int
	ConnMaxLifetimeInMinute int
}

Database ...

type PDUAddr

type PDUAddr struct {
	Ton byte
	Npi byte
}

PDUAddr ...

type PDUConfigs

type PDUConfigs struct {
	SourceAddr           *PDUAddr
	DestinationAddr      *PDUAddr
	AddRange             byte
	SubmitRespRadix      byte
	DeliverReportRadix   byte
	ProtocolID           byte
	RegisteredDelivery   byte
	ReplaceIfPresentFlag byte
	EsmClass             byte
}

PDUConfigs pdu configurations

type Runtime

type Runtime struct {
	LogDir           string
	TempDir          string
	CurrentDirectory string
}

Runtime configuration

type SMSSenderAuth

type SMSSenderAuth struct {
	Username string
	Password string
}

SMSSenderAuth basic auth of sms sender

type Secure

type Secure struct {
	// EnableTLS or not
	EnableTLS bool

	// CertFile where server certificate file is
	CertFile string

	// KeyFile where server key file is
	KeyFile string

	// SipHashSum0
	SipHashSum0 uint64

	// SipHashSum1
	SipHashSum1 uint64
}

Secure config

type SmsGateway

type SmsGateway struct {
	Addr       string
	Port       int
	SystemID   string
	Password   string
	SystemType string
	// Alias default alias
	Alias                         string
	MaxSmsLength                  int
	SendSMSIntervalInMiliSec      int
	EnquiryIntervalInSec          int
	SeqMod                        uint
	SeqSeed                       uint
	IsDebugMode                   bool
	ShowHeartBeat                 bool
	CacheDurForProcessStatusInSec int
	NumConcurrentHandler          int
	SendSMSExpiredInMinute        int
}

SmsGateway configuration

type WebServer

type WebServer struct {
	// BodyLimit The body limit is determined based on both Content-Length request header and actual content read, which makes it super secure.
	// Limit can be specified as 4x or 4xB, where x is one of the multiple from K, M, G, T or P. Example: 2M = 2 Megabyte
	BodyLimit string

	// Port Which port WebServer would listen
	Port int

	// Secure
	Secure Secure
}

WebServer hold configurations for WebServer

Jump to

Keyboard shortcuts

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