Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStreamable ¶
IsStreamable says whether the given protocol can be used for streaming into hot functions.
Types ¶
type ContainerIO ¶
type ContainerIO interface { IsStreamable() bool Dispatch(ctx context.Context, t task.Request) error }
ContainerIO defines the interface used to talk to a hot function. Internally, a protocol must know when to alternate between stdin and stdout. It returns any protocol error, if present.
type DefaultProtocol ¶
type DefaultProtocol struct { }
DefaultProtocol is the protocol used by cold-containers
func (*DefaultProtocol) IsStreamable ¶
func (p *DefaultProtocol) IsStreamable() bool
type HTTPProtocol ¶
type HTTPProtocol struct {
// contains filtered or unexported fields
}
HTTPProtocol converts stdin/stdout streams into HTTP/1.1 compliant communication. It relies on Content-Length to know when to stop reading from containers stdout. It also mandates valid HTTP headers back and forth, thus returning errors in case of parsing problems.
func (*HTTPProtocol) IsStreamable ¶
func (p *HTTPProtocol) IsStreamable() bool
type Protocol ¶
type Protocol string
Protocol defines all protocols that operates a ContainerIO.
const ( Default Protocol = models.FormatDefault HTTP Protocol = models.FormatHTTP Empty Protocol = "" )
hot function protocols