Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { ID string Port int HealthCheckPath string // use http check if it's set CheckTimeout string CheckInterval string CheckTTL string DeregisterCriticalServiceAfter string Version string }
AppConfig is application config
type ConsulConfig ¶
ConsulConfig is consul config
type EmptyError ¶
type EmptyError struct {
// contains filtered or unexported fields
}
EmptyError is empty upstream pool error
type HealthChecker ¶ added in v0.4.4
type HealthChecker func() error
HealthChecker is the customized health check function
type Option ¶
type Option func(*Options)
Option is for setting options
func WithHealthCheck ¶ added in v0.4.4
func WithHealthCheck(hc HealthChecker) Option
WithHealthCheck sets health checker
func WithUpstream ¶
func WithUpstream(upstreamCfg UpstreamConfig) Option
WithUpstream sets upstream config
type Options ¶
type Options struct { Logger log.Logger App AppConfig Consul ConsulConfig Upstream UpstreamConfig HealthCheck HealthChecker }
Options is soa options
type SOA ¶
type SOA struct { Options // inherited options ConsulClient *consulapi.Client Service *consulapi.AgentServiceRegistration // contains filtered or unexported fields }
SOA is for soa service registration and discovery
func (*SOA) ResolveWithVersion ¶ added in v0.6.0
Resolve service address by app id & version
type UpstreamConfig ¶
UpstreamConfig is upstream config
Click to show internal directories.
Click to hide internal directories.