conf

package
v0.0.0-...-b13eba1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright (c) 2020 Shuo Ding Open Source: MIT License Author: SDing <deen.job@qq.com> License that can be found in the LICENSE file.

Index

Constants

View Source
const (
	// DefaultPort default port
	DefaultPort = "9598"
	// DefaultAddress  default address
	DefaultAddress = "127.0.0.1"
	// DefaultPath default config file path
	DefaultPath = "./config.ini"
)
View Source
const (
	// RuleKindNumber is Number
	RuleKindNumber = iota
	// RuleKindLower is letter lower
	RuleKindLower
	// RuleKindUpper is letter upper
	RuleKindUpper
	// RuleKindAll is all rule
	RuleKindAll
)

Variables

View Source
var (
	// DefaultAllow default allow address
	DefaultAllow = make([]string, 0, 8)
	// DefaultPassword default password
	DefaultPassword = string(Krand(16, RuleKindAll))
)

Functions

func Krand

func Krand(size int, kind int) []byte

Krand is random string func ASCII CODE

Types

type Option

type Option struct {
	// Bind IP
	Address string
	// Bind Port 0-65535
	Port string
	// Allow access IP
	AllowIP []string
	// Auth password
	Password string
}

Option is create FastMQ server parameter

func DefaultConfig

func DefaultConfig() *Option

DefaultConfig genreate server option default cofing

func LoadConfig

func LoadConfig(path string) *Option

LoadConfig load Configuration File

func LoadOption

func LoadOption() *Option

LoadOption load Configuration File,return option pointer

func NewConfig

func NewConfig() *Option

NewConfig customize server config option Example Code : op := mq.NewConfig() op.Password = "XXXXXXX"

Jump to

Keyboard shortcuts

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