Documentation ¶
Index ¶
- Variables
- type Client
- type ClientOption
- type ClientOptions
- type Server
- type ServerOption
- func Address(a string) ServerOption
- func Id(id string) ServerOption
- func Metadata(md map[string]string) ServerOption
- func Name(n string) ServerOption
- func RegisterInterval(t time.Duration) ServerOption
- func RegisterTTL(t time.Duration) ServerOption
- func TLS(certFile, keyFile string) ServerOption
- func Version(v string) ServerOption
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultName = "stark.http.server" DefaultVersion = time.Now().Format("2006.01.02.15.04") DefaultId = uuid.New().String() DefaultAddress = ":0" DefaultRegisterInterval = time.Second * 30 DefaultRegisterTTL = time.Minute )
View Source
var (
DefaultTimeout = time.Second * 2
)
Functions ¶
This section is empty.
Types ¶
type ClientOption ¶
type ClientOption func(*ClientOptions)
func Scheme ¶
func Scheme(s string) ClientOption
func Timeout ¶
func Timeout(t time.Duration) ClientOption
type ClientOptions ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Options ¶
func (s *Server) Options() ServerOptions
type ServerOption ¶
type ServerOption func(o *ServerOptions)
func Metadata ¶
func Metadata(md map[string]string) ServerOption
Metadata associated with the service
func RegisterInterval ¶
func RegisterInterval(t time.Duration) ServerOption
func RegisterTTL ¶
func RegisterTTL(t time.Duration) ServerOption
func TLS ¶
func TLS(certFile, keyFile string) ServerOption
Click to show internal directories.
Click to hide internal directories.