Documentation ¶
Index ¶
Constants ¶
View Source
const ( //StdPort defines the standard port for thttp yarf StdPort string = "23456" //StdProtocol defines the standard protocol for thttp yarf StdProtocol string = "http" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryDNSA ¶
type DiscoveryDNSA struct { Protocol string Host string Port string Resolv string // contains filtered or unexported fields }
DiscoveryDNSA defines a discover using dns A records to round robin
func (*DiscoveryDNSA) URL ¶
func (d *DiscoveryDNSA) URL() (string, error)
URL implements the Discovery interface
type DiscoveryDefault ¶
DiscoveryDefault defines the default discovery using the provided host name
func (*DiscoveryDefault) URL ¶
func (d *DiscoveryDefault) URL() (string, error)
URL implements the Discovery interface
type HTTPTransporter ¶
type HTTPTransporter struct {
// contains filtered or unexported fields
}
HTTPTransporter implements the yarf.Transport for using http as a transport protocol
func NewHTTPTransporter ¶
func NewHTTPTransporter(options Options) (*HTTPTransporter, error)
NewHTTPTransporter a constructor for the HTTPTransporter
func (*HTTPTransporter) Call ¶
func (h *HTTPTransporter) Call(ctx context.Context, function string, requestData []byte) (response []byte, err error)
Call implements client side call of transporter
func (*HTTPTransporter) Close ¶
func (h *HTTPTransporter) Close() error
Close halts the http server to receive requests
func (*HTTPTransporter) Listen ¶
func (h *HTTPTransporter) Listen(function string, toExec func(ctx context.Context, requestData []byte) (responseData []byte)) (err error)
Listen defines the function that will handle yarf requests
func (*HTTPTransporter) Start ¶
func (h *HTTPTransporter) Start() error
Start initiates the http server to receive requests
Click to show internal directories.
Click to hide internal directories.