Documentation ¶
Index ¶
- Constants
- func NewConnection(discovery Discovery) titan.IConnection
- func NewRestClient() *titan.Client
- type Connection
- func (c *Connection) Close()
- func (c *Connection) Drain()
- func (c *Connection) Flush() error
- func (c *Connection) Publish(subject string, v interface{}) error
- func (c *Connection) SendRequest(rq *titan.Request, subject string) (*titan.Response, error)
- func (c *Connection) Subscribe(subject string, cb titan.Handler) (titan.ISubscription, error)
- type ConsulDiscovery
- type Discovery
- type EnvDiscovery
- type IServer
- type Option
- func Cores(domains []string) Option
- func Logger(logger logur.Logger) Option
- func Port(v string) Option
- func Routes(r func(titan.Router)) Option
- func SocketEnable(v bool) Option
- func SocketRoute(path string, h socket.HandlerFunc) Option
- func Static(path, directory string) Option
- func TlsCert(v string) Option
- func TlsEnable(v bool) Option
- func TlsKey(v string) Option
- type Options
- type Server
Constants ¶
View Source
const ( C_TlsEnable = "tls.enable" C_TlsCert = "tls.cert" C_TlsKey = "tls.key" C_Port = "port" )
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
func NewConnection(discovery Discovery) titan.IConnection
func NewRestClient ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Drain ¶
func (c *Connection) Drain()
func (*Connection) Flush ¶
func (c *Connection) Flush() error
func (*Connection) Publish ¶
func (c *Connection) Publish(subject string, v interface{}) error
func (*Connection) SendRequest ¶
func (*Connection) Subscribe ¶ added in v1.0.48
func (c *Connection) Subscribe(subject string, cb titan.Handler) (titan.ISubscription, error)
type ConsulDiscovery ¶
type ConsulDiscovery struct { }
Consul service discovery, not implemented yet
type EnvDiscovery ¶
type EnvDiscovery struct { }
func NewEnvDiscovery ¶
func NewEnvDiscovery() *EnvDiscovery
func (*EnvDiscovery) LookupService ¶
func (d *EnvDiscovery) LookupService(serviceName string) (string, error)
get value from environment variables
type Option ¶
Option is a function on the options for a connection.
func SocketEnable ¶
func SocketRoute ¶
func SocketRoute(path string, h socket.HandlerFunc) Option
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options can be used to create a customized connection.
Click to show internal directories.
Click to hide internal directories.