config

package
v0.0.0-...-4cc5885 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddrConfig

type AddrConfig struct {
	Prefix       string `yaml:"prefix"`
	Suffix       string `yaml:"suffix"`
	GenerateLen  int    `default:"6" yaml:"generate-length"`
	GenerateType string `default:"sequence" yaml:"generate-type"`
	Start        int    `default:"0" yaml:"start"`
	Stop         int    `yaml:"stop"`
}

type AppConfig

type AppConfig struct {
	App struct {
		SmppConn []SmppConfig `yaml:"smpp"`
		Rest     struct {
			Addr string `default:"0.0.0.0" yaml:"addr"`
			Port uint16 `default:"8080" yaml:"port"`
		} `yaml:"rest"`
		Log struct {
			Level string `default:"info" yaml:"level"`
		} `yaml:"log"`
	} `yaml:"service"`
}

func GetSmppConf

func GetSmppConf(path string) (*AppConfig, error)

func (*AppConfig) GetRestAddr

func (ac *AppConfig) GetRestAddr() string

func (*AppConfig) UnmarshalYAML

func (c *AppConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

type MessageConfig

type MessageConfig struct {
	Send struct {
		Src struct {
			Npi   uint16 `default:"1" yaml:"npi"`
			Ton   uint16 `default:"1" yaml:"ton"`
			Oaddr string `yaml:"oaddr"`
		} `yaml:"src"`
		Dst struct {
			Npi   uint16     `default:"1" yaml:"npi"`
			Ton   uint16     `default:"1" yaml:"ton"`
			Daddr AddrConfig `yaml:"daddr"`
		} `yaml:"dst"`
		RequireSR bool   `default:"false" yaml:"require-sr"`
		Content   string `yaml:"content"`
		Dcs       int    `default:"0" yaml:"dcs"`
	} `yaml:"send"`
}

type SmppConfig

type SmppConfig struct {
	Server struct {
		Addr     string `default:"localhost" yaml:"addr"`
		Port     uint16 `default:"5588" yaml:"port"`
		User     string `yaml:"username"`
		Password string `yaml:"password"`
	} `yaml:"server"`
	Client struct {
		Type  string `default:"transmitter" yaml:"bind-type"`
		Count uint16 `default:"10" yaml:"conn-num"`
	}
	Message MessageConfig `yaml:"message"`
}

func (*SmppConfig) IsTransmitter

func (s *SmppConfig) IsTransmitter() bool

Jump to

Keyboard shortcuts

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