Documentation
¶
Index ¶
- func InitPathInfo(configPath *string)
- func IsNil(i interface{}) bool
- type App
- type Application
- type Config
- type Option
- type Port
- type Util
- func (u *Util) Auth() (authorization.Auth, error)
- func (u *Util) Cache() (cache.Cache, error)
- func (u *Util) CacheDb(db int) (cache.Cache, error)
- func (u *Util) CheckPort(svcName string) bool
- func (u *Util) Close()
- func (u *Util) Db(ctx context.Context) (*orm.Gorm, error)
- func (u *Util) DbReadOnly(ctx context.Context) (*orm.Gorm, error)
- func (u *Util) Es() (*es.ES, error)
- func (u *Util) Exporter() (opentelemetry.SpanExporter, error)
- func (u *Util) Locker(key, identification string, RefreshTime time.Duration) (locker.Locker, error)
- func (u *Util) Mq() (mq.Producer, error)
- func (u *Util) Port(svcName string) Port
- func (u *Util) Register() (register.Register, error)
- func (u *Util) Rpc(ctx context.Context, serverName string) (conn *rpc.Conn, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitPathInfo ¶
func InitPathInfo(configPath *string)
Types ¶
type App ¶
type App struct {
Application
// contains filtered or unexported fields
}
type Application ¶
type Application interface {
Start() error
Stop()
}
func NewApp ¶
func NewApp(opts ...Option) (Application, error)
type Config ¶
type Config struct {
//ServerName string `json:"server_name" yaml:"server_name"`
//Type ipType `json:"type" yaml:"type"`
IP string `json:"ip" yaml:"ip"`
Servers map[string]Port `json:"servers" yaml:"servers"` // 所有服务Port信息
ConfigInitType string `json:"config_init_type"` // file:读本地配置 center:读取配置中心
RpcType string `json:"rpc_type" yaml:"rpc_type"` // 支持local,kubernetes,register
Env string `json:"env" yaml:"env"`
// contains filtered or unexported fields
}
type Option ¶
func Tracing ¶
func Tracing(exporter opentelemetry.SpanExporter, serviceName string) Option
type Util ¶
type Util struct {
Info *Config
Sf *singleflight.Group
// contains filtered or unexported fields
}
func (*Util) DbReadOnly ¶
DbReadOnly 只读库
func (*Util) Exporter ¶
func (u *Util) Exporter() (opentelemetry.SpanExporter, error)
Click to show internal directories.
Click to hide internal directories.