conf

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventModeNats   = "nats"   //使用nats来通讯
	EventModeDirect = "direct" //直接调用
)
View Source
const (
	ClientModeGrpc   = "grpc"
	ClientModeDirect = "direct"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConf added in v0.3.0

type AuthConf struct {
	IpRange []string //白名单ip 及ip段
	Users   []AuthUserInfo
}

func (*AuthConf) Auth added in v0.3.0

func (a *AuthConf) Auth(userName, password, ipaddr string) bool

Auth 在名单内返回true

type AuthUserInfo added in v0.3.0

type AuthUserInfo struct {
	UserName string // 内部为服务名
	Password string // 密码
}

type DevLinkConf

type DevLinkConf struct {
	Mode    string    `json:",default=mqtt"` //模式 默认mqtt
	SubMode string    `json:",default=emq"`  //
	Mqtt    *MqttConf `json:",optional"`
}

type EventConf

type EventConf struct {
	Mode string `json:",default=nats,options=nats|direct"`
	Nats NatsConf
}

type MapConf added in v0.3.0

type MapConf struct {
	Mode      string `json:",default=baidu"`
	AccessKey string
}

type MinioConf

type MinioConf struct {
	Endpoint        string `json:",default=127.0.0.1:9000"`
	AccessKeyID     string
	SecretAccessKey string
	UseSSL          bool   `json:",optional"`
	GateWayHost     string `json:",default=127.0.0.1:7777"` //api访问地址
}

type ModeConf

type ModeConf struct {
	Mode   string `json:",default=direct,options=grpc|direct"`
	Enable bool   `json:",default=true"`
}

type MqttConf

type MqttConf struct {
	ClientID string   //在mqtt中的clientID
	Brokers  []string //mqtt服务器节点
	User     string   `json:",default=root"` //用户名
	Pass     string   `json:",optional"`     //密码
}

type NatsConf

type NatsConf struct {
	Url   string `json:",default=nats://127.0.0.1:4222"` //nats的连接url
	User  string `json:",optional"`                      //用户名
	Pass  string `json:",optional"`                      //密码
	Token string `json:",optional"`
}

type OSSConf

type OSSConf struct {
	OSS          string    `json:",default=minio,options=minio|ceph|aliyun|tenxunyun"`
	Minio        MinioConf `json:",optional"`
	AccessSecret string    `json:",default=password"` //jwt 认证秘钥
	AccessExpire int64     `json:",default=600"`      //jwt 过期时间 单位:秒
}

type ProxyConf added in v0.3.0

type ProxyConf struct {
	FrontDir         string            `json:",default=./dist"`                       //前端文件路径
	FrontDefaultPage string            `json:",default=front/iThingsCore/index.html"` //前端默认文件地址
	UrlProxy         map[string]string `json:",optional"`                             //反向http代理配置
}

反向代理配置

type RpcClientConf

type RpcClientConf struct {
	Conf zrpc.RpcClientConf `json:",optional"`
	ModeConf
}

Jump to

Keyboard shortcuts

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