Documentation ¶
Index ¶
- Constants
- type BeegoConfig
- type ConfDelta
- type Config
- type Consul
- func (c *Consul) CheckKey(key string, opts *stdConsul.QueryOptions) bool
- func (c *Consul) DeleteKey(key string) error
- func (c *Consul) GetConsulClient() *stdConsul.Client
- func (c *Consul) GetGoKitConsulClient() goKitConsul.Client
- func (c *Consul) GetKey(key string) (string, error)
- func (c *Consul) Health() bool
- func (c Consul) New() *Consul
- func (c *Consul) RegistryService(service, port, healthCheckURL string) error
- func (c *Consul) SetKey(key, value string) error
- func (c *Consul) WatchKey(key string, stop chan bool) <-chan *WatchResp
- type Consumer
- type EndpointMap
- type EnvVar
- type Event
- type EventMap
- type HealthCheck
- type HttpClient
- func (c HttpClient) Delete(respObj interface{}, url string, urlParams []string) error
- func (c HttpClient) Execute(reqObj interface{}, respObj interface{}, method, url string, ...) error
- func (c HttpClient) Get(respObj interface{}, url string, urlParams []string) error
- func (c HttpClient) GetWithHeader(respObj interface{}, url string, header map[string]string, urlParams []string) error
- func (c HttpClient) Post(reqObj interface{}, respObj interface{}, url string, urlParams []string) error
- func (c HttpClient) PostWithHeader(reqObj interface{}, respObj interface{}, header map[string]string, url string, ...) error
- func (c HttpClient) Put(reqObj interface{}, respObj interface{}, url string, urlParams []string) error
- func (c HttpClient) PutWithHeader(reqObj interface{}, respObj interface{}, header map[string]string, url string, ...) error
- type LeaderElection
- type NATSConsumer
- type NATSProducer
- type PageRequest
- type Paginator
- type Producer
- type RocketMqConsumer
- type RocketMqProducer
- type Role
- type Utils
- func (u Utils) Decode(data, keyType string) (result string, err error)
- func (u Utils) GetAppName() string
- func (u Utils) GetAppPort() string
- func (u Utils) GetMyIPAddr() string
- func (u Utils) GetMyIdentity() string
- func (u Utils) GetRunMode() string
- func (u Utils) GetType(v interface{}) (ty reflect.Type)
- func (u Utils) NatsHealth(url string) error
- func (u Utils) ObjectName(v interface{}) (name string)
- func (u Utils) ObjectNameAppend(v interface{}, append string) string
- func (u Utils) ReadConfig(path string) (BeegoConfig, error)
- func (u Utils) SystemHealth() error
- type WatchResp
- type WsServer
Constants ¶
View Source
const ( ConfigFileName = "data" ConfigProvider = "consul" ConfigPathFmt = "/config/%s/%s" ConfigFmtYaml = "yaml" ConfigFmtJson = "json" ConfigWatchInterval = 1 * time.Second )
View Source
const ( ConsulDeRegisterCriticalServiceAfter = "10m" ConsulInterval = "15s" ConsulTTL = "10s" ConsulDefaultSchema = "http://" )
View Source
const ( // system level AppName = "appname" AppPort = "httpport" // ca relative KeyType = "keyType" CertType = "certType" KeyStart = "-----BEGIN RSA PRIVATE KEY-----" KeyEnd = "-----END RSA PRIVATE KEY-----" CertStart = "-----BEGIN CERTIFICATE-----" CertEnd = "-----END CERTIFICATE-----" // config path ConfPath = "./conf/app.conf" )
View Source
const (
EventPathFmt = "event/%s/%s"
)
View Source
const (
LeaderElectionPathFmt = "lock/%s/leader"
)
View Source
const (
SlangerEventTypeOperationStatus = "operationStatus"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeegoConfig ¶
type ConfDelta ¶
type ConfDelta struct { OData interface{} NData interface{} }
///////////////////////////////// config file ////////////////////////////////
type Config ¶
type Config struct { FileName string Format string Data interface{} // contains filtered or unexported fields }
func GetConfInst ¶
func GetConfInst(data ...interface{}) *Config
func (*Config) DeRegister ¶
type Consul ¶
type Consul struct {
// contains filtered or unexported fields
}
func (*Consul) GetConsulClient ¶
func (*Consul) GetGoKitConsulClient ¶
func (c *Consul) GetGoKitConsulClient() goKitConsul.Client
func (*Consul) RegistryService ¶
type Consumer ¶
type Consumer struct { Group string Topic string URL string ClusterId string ClientId string DurableName string CallBack func(*stan.Msg) NConn *nats.Conn SConn stan.Conn // contains filtered or unexported fields }
func (*Consumer) RunWithSubscribe ¶
type EndpointMap ¶
type EndpointMap struct {
// contains filtered or unexported fields
}
endpoint map
func GetEndpointMap ¶
func GetEndpointMap() *EndpointMap
type EnvVar ¶
func (EnvVar) GetConsulAddr ¶
func (EnvVar) GetConsulPort ¶
func (EnvVar) GetConsulURI ¶
type EventMap ¶
type EventMap struct {
// contains filtered or unexported fields
}
func GetEventMap ¶
func GetEventMap() *EventMap
func (*EventMap) DeRegistry ¶
type HealthCheck ¶
type HealthCheck struct { }
func (*HealthCheck) Check ¶
func (h *HealthCheck) Check() error
type HttpClient ¶
type HttpClient struct {
Service string
}
func (HttpClient) Delete ¶
func (c HttpClient) Delete(respObj interface{}, url string, urlParams []string) error
func (HttpClient) Get ¶
func (c HttpClient) Get(respObj interface{}, url string, urlParams []string) error
func (HttpClient) GetWithHeader ¶
func (HttpClient) Post ¶
func (c HttpClient) Post(reqObj interface{}, respObj interface{}, url string, urlParams []string) error
func (HttpClient) PostWithHeader ¶
func (HttpClient) Put ¶
func (c HttpClient) Put(reqObj interface{}, respObj interface{}, url string, urlParams []string) error
func (HttpClient) PutWithHeader ¶
type LeaderElection ¶
type LeaderElection struct { Consul *Consul TTL time.Duration Callback func(leader bool) // contains filtered or unexported fields }
func (*LeaderElection) Run ¶
func (l *LeaderElection) Run()
type NATSConsumer ¶
type NATSConsumer struct { Group string // no used for NATS Topic string URL string CallBack func(*nats.Msg) Conn *nats.Conn }
func (*NATSConsumer) Run ¶
func (c *NATSConsumer) Run() error
func (*NATSConsumer) Shutdown ¶
func (c *NATSConsumer) Shutdown()
type NATSProducer ¶
func (*NATSProducer) Shutdown ¶
func (p *NATSProducer) Shutdown()
func (*NATSProducer) Start ¶
func (p *NATSProducer) Start() error
type PageRequest ¶
page begin from 1
type Paginator ¶
type Paginator struct { *PageRequest TotalPages int `json:"totalPages"` TotalElements int `json:"totalElements"` Content interface{} `json:"content"` }
page search util
func (Paginator) GetOffset ¶
func (p Paginator) GetOffset(r *PageRequest) int
func (Paginator) GetTotalPages ¶
func (p Paginator) GetTotalPages(r *PageRequest, totalElements int) int
type Producer ¶
type RocketMqConsumer ¶
type RocketMqConsumer struct { Group string Topic string NameServer string CallBack func([]*rocketmq.MessageExt) error // contains filtered or unexported fields }
func (*RocketMqConsumer) Run ¶
func (c *RocketMqConsumer) Run() error
func (*RocketMqConsumer) Shutdown ¶
func (c *RocketMqConsumer) Shutdown()
type RocketMqProducer ¶
type RocketMqProducer struct { Group string NameServer string // contains filtered or unexported fields }
func (*RocketMqProducer) Shutdown ¶
func (p *RocketMqProducer) Shutdown()
func (*RocketMqProducer) Start ¶
func (p *RocketMqProducer) Start() error
type Role ¶
type Role struct {
// contains filtered or unexported fields
}
func GetRoleInst ¶
func GetRoleInst() *Role
type Utils ¶
type Utils struct { }
func (Utils) GetAppName ¶
func (Utils) GetAppPort ¶
func (Utils) GetMyIPAddr ¶
func (Utils) GetMyIdentity ¶
func (Utils) GetRunMode ¶
func (Utils) NatsHealth ¶
func (Utils) ObjectName ¶
func (Utils) ObjectNameAppend ¶
func (Utils) ReadConfig ¶
func (u Utils) ReadConfig(path string) (BeegoConfig, error)
func (Utils) SystemHealth ¶
type WsServer ¶
type WsServer struct { AppId string Key string Secret string Host string // contains filtered or unexported fields }
func (*WsServer) PushMsgToUI ¶
func (*WsServer) PushOperationStatusToUI ¶
Click to show internal directories.
Click to hide internal directories.