Documentation ¶
Index ¶
- Constants
- Variables
- type Authenticator
- type Config
- type Conn
- type Header
- type HeaderReader
- type HeaderWriter
- type Method
- type NoOpReader
- type NoOpWriter
- type Reader
- type RequestConfig
- func (*RequestConfig) Descriptor() ([]byte, []int)deprecated
- func (v *RequestConfig) GetFullVersion() string
- func (x *RequestConfig) GetHeader() []*Header
- func (x *RequestConfig) GetMethod() *Method
- func (v *RequestConfig) GetMethodValue() string
- func (x *RequestConfig) GetUri() []string
- func (x *RequestConfig) GetVersion() *Version
- func (v *RequestConfig) GetVersionValue() string
- func (v *RequestConfig) PickHeaders() []string
- func (v *RequestConfig) PickURI() string
- func (*RequestConfig) ProtoMessage()
- func (x *RequestConfig) ProtoReflect() protoreflect.Message
- func (x *RequestConfig) Reset()
- func (x *RequestConfig) String() string
- type ResponseConfig
- func (*ResponseConfig) Descriptor() ([]byte, []int)deprecated
- func (v *ResponseConfig) GetFullVersion() string
- func (x *ResponseConfig) GetHeader() []*Header
- func (x *ResponseConfig) GetStatus() *Status
- func (v *ResponseConfig) GetStatusValue() *Status
- func (x *ResponseConfig) GetVersion() *Version
- func (v *ResponseConfig) GetVersionValue() string
- func (v *ResponseConfig) HasHeader(header string) bool
- func (v *ResponseConfig) PickHeaders() []string
- func (*ResponseConfig) ProtoMessage()
- func (x *ResponseConfig) ProtoReflect() protoreflect.Message
- func (x *ResponseConfig) Reset()
- func (x *ResponseConfig) String() string
- type Status
- type Version
- type Writer
Constants ¶
View Source
const ( // CRLF is the line ending in HTTP header CRLF = "\r\n" // ENDING is the double line ending between HTTP header and body. ENDING = CRLF + CRLF )
Variables ¶
View Source
var ( ErrHeaderToLong = errors.New("Header too long.") ErrHeaderMisMatch = errors.New("Header Mismatch.") )
View Source
var File_transport_internet_headers_http_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func NewAuthenticator ¶
func NewAuthenticator(ctx context.Context, config *Config) (Authenticator, error)
func (Authenticator) GetClientWriter ¶
func (a Authenticator) GetClientWriter() *HeaderWriter
func (Authenticator) GetServerWriter ¶
func (a Authenticator) GetServerWriter() *HeaderWriter
type Config ¶
type Config struct { // Settings for authenticating requests. If not set, client side will not send // authentication header, and server side will bypass authentication. Request *RequestConfig `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` // Settings for authenticating responses. If not set, client side will bypass // authentication, and server side will not send authentication header. Response *ResponseConfig `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) GetRequest ¶
func (x *Config) GetRequest() *RequestConfig
func (*Config) GetResponse ¶
func (x *Config) GetResponse() *ResponseConfig
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type Header ¶
type Header struct { // "Accept", "Cookie", etc Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Each entry must be valid in one piece. Random entry will be chosen if // multiple entries present. Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Header) Descriptor
deprecated
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type HeaderReader ¶
type HeaderReader struct {
// contains filtered or unexported fields
}
func (*HeaderReader) ExpectThisRequest ¶
func (h *HeaderReader) ExpectThisRequest(expectedHeader *RequestConfig) *HeaderReader
type HeaderWriter ¶
type HeaderWriter struct {
// contains filtered or unexported fields
}
func NewHeaderWriter ¶
func NewHeaderWriter(header *buf.Buffer) *HeaderWriter
type Method ¶
type Method struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
HTTP method. Default value "GET".
func (*Method) Descriptor
deprecated
func (*Method) ProtoMessage ¶
func (*Method) ProtoMessage()
func (*Method) ProtoReflect ¶
func (x *Method) ProtoReflect() protoreflect.Message
type NoOpReader ¶
type NoOpReader struct{}
type NoOpWriter ¶
type NoOpWriter struct{}
type RequestConfig ¶
type RequestConfig struct { // Full HTTP version like "1.1". Version *Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // GET, POST, CONNECT etc Method *Method `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` // URI like "/login.php" Uri []string `protobuf:"bytes,3,rep,name=uri,proto3" json:"uri,omitempty"` Header []*Header `protobuf:"bytes,4,rep,name=header,proto3" json:"header,omitempty"` // contains filtered or unexported fields }
func (*RequestConfig) Descriptor
deprecated
func (*RequestConfig) Descriptor() ([]byte, []int)
Deprecated: Use RequestConfig.ProtoReflect.Descriptor instead.
func (*RequestConfig) GetFullVersion ¶
func (v *RequestConfig) GetFullVersion() string
func (*RequestConfig) GetHeader ¶
func (x *RequestConfig) GetHeader() []*Header
func (*RequestConfig) GetMethod ¶
func (x *RequestConfig) GetMethod() *Method
func (*RequestConfig) GetMethodValue ¶
func (v *RequestConfig) GetMethodValue() string
func (*RequestConfig) GetUri ¶
func (x *RequestConfig) GetUri() []string
func (*RequestConfig) GetVersion ¶
func (x *RequestConfig) GetVersion() *Version
func (*RequestConfig) GetVersionValue ¶
func (v *RequestConfig) GetVersionValue() string
func (*RequestConfig) PickHeaders ¶
func (v *RequestConfig) PickHeaders() []string
func (*RequestConfig) PickURI ¶
func (v *RequestConfig) PickURI() string
func (*RequestConfig) ProtoMessage ¶
func (*RequestConfig) ProtoMessage()
func (*RequestConfig) ProtoReflect ¶
func (x *RequestConfig) ProtoReflect() protoreflect.Message
func (*RequestConfig) Reset ¶
func (x *RequestConfig) Reset()
func (*RequestConfig) String ¶
func (x *RequestConfig) String() string
type ResponseConfig ¶
type ResponseConfig struct { Version *Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` Status *Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` Header []*Header `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty"` // contains filtered or unexported fields }
func (*ResponseConfig) Descriptor
deprecated
func (*ResponseConfig) Descriptor() ([]byte, []int)
Deprecated: Use ResponseConfig.ProtoReflect.Descriptor instead.
func (*ResponseConfig) GetFullVersion ¶
func (v *ResponseConfig) GetFullVersion() string
func (*ResponseConfig) GetHeader ¶
func (x *ResponseConfig) GetHeader() []*Header
func (*ResponseConfig) GetStatus ¶
func (x *ResponseConfig) GetStatus() *Status
func (*ResponseConfig) GetStatusValue ¶
func (v *ResponseConfig) GetStatusValue() *Status
func (*ResponseConfig) GetVersion ¶
func (x *ResponseConfig) GetVersion() *Version
func (*ResponseConfig) GetVersionValue ¶
func (v *ResponseConfig) GetVersionValue() string
func (*ResponseConfig) HasHeader ¶
func (v *ResponseConfig) HasHeader(header string) bool
func (*ResponseConfig) PickHeaders ¶
func (v *ResponseConfig) PickHeaders() []string
func (*ResponseConfig) ProtoMessage ¶
func (*ResponseConfig) ProtoMessage()
func (*ResponseConfig) ProtoReflect ¶
func (x *ResponseConfig) ProtoReflect() protoreflect.Message
func (*ResponseConfig) Reset ¶
func (x *ResponseConfig) Reset()
func (*ResponseConfig) String ¶
func (x *ResponseConfig) String() string
type Status ¶
type Status struct { // Status code. Default "200". Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // Statue reason. Default "OK". Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` // contains filtered or unexported fields }
func (*Status) Descriptor
deprecated
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type Version ¶
type Version struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
HTTP version. Default value "1.1".
func (*Version) Descriptor
deprecated
func (*Version) ProtoMessage ¶
func (*Version) ProtoMessage()
func (*Version) ProtoReflect ¶
func (x *Version) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.