Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetRequest() *RequestConfig
- func (m *Config) GetResponse() *ResponseConfig
- func (*Config) ProtoMessage()
- func (m *Config) Reset()
- func (m *Config) String() string
- func (m *Config) XXX_DiscardUnknown()
- func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Config) XXX_Merge(src proto.Message)
- func (m *Config) XXX_Size() int
- func (m *Config) XXX_Unmarshal(b []byte) error
- type Header
- func (*Header) Descriptor() ([]byte, []int)
- func (m *Header) GetName() string
- func (m *Header) GetValue() []string
- func (*Header) ProtoMessage()
- func (m *Header) Reset()
- func (m *Header) String() string
- func (m *Header) XXX_DiscardUnknown()
- func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Header) XXX_Merge(src proto.Message)
- func (m *Header) XXX_Size() int
- func (m *Header) XXX_Unmarshal(b []byte) error
- type HeaderReader
- type HeaderWriter
- type HttpAuthenticator
- type HttpConn
- type Method
- func (*Method) Descriptor() ([]byte, []int)
- func (m *Method) GetValue() string
- func (*Method) ProtoMessage()
- func (m *Method) Reset()
- func (m *Method) String() string
- func (m *Method) XXX_DiscardUnknown()
- func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Method) XXX_Merge(src proto.Message)
- func (m *Method) XXX_Size() int
- func (m *Method) XXX_Unmarshal(b []byte) error
- type NoOpReader
- type NoOpWriter
- type Reader
- type RequestConfig
- func (*RequestConfig) Descriptor() ([]byte, []int)
- func (v *RequestConfig) GetFullVersion() string
- func (m *RequestConfig) GetHeader() []*Header
- func (m *RequestConfig) GetMethod() *Method
- func (v *RequestConfig) GetMethodValue() string
- func (m *RequestConfig) GetUri() []string
- func (m *RequestConfig) GetVersion() *Version
- func (v *RequestConfig) GetVersionValue() string
- func (v *RequestConfig) PickHeaders() []string
- func (v *RequestConfig) PickUri() string
- func (*RequestConfig) ProtoMessage()
- func (m *RequestConfig) Reset()
- func (m *RequestConfig) String() string
- func (m *RequestConfig) XXX_DiscardUnknown()
- func (m *RequestConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RequestConfig) XXX_Merge(src proto.Message)
- func (m *RequestConfig) XXX_Size() int
- func (m *RequestConfig) XXX_Unmarshal(b []byte) error
- type ResponseConfig
- func (*ResponseConfig) Descriptor() ([]byte, []int)
- func (v *ResponseConfig) GetFullVersion() string
- func (m *ResponseConfig) GetHeader() []*Header
- func (m *ResponseConfig) GetStatus() *Status
- func (v *ResponseConfig) GetStatusValue() *Status
- func (m *ResponseConfig) GetVersion() *Version
- func (v *ResponseConfig) GetVersionValue() string
- func (v *ResponseConfig) HasHeader(header string) bool
- func (v *ResponseConfig) PickHeaders() []string
- func (*ResponseConfig) ProtoMessage()
- func (m *ResponseConfig) Reset()
- func (m *ResponseConfig) String() string
- func (m *ResponseConfig) XXX_DiscardUnknown()
- func (m *ResponseConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ResponseConfig) XXX_Merge(src proto.Message)
- func (m *ResponseConfig) XXX_Size() int
- func (m *ResponseConfig) XXX_Unmarshal(b []byte) error
- type Status
- func (*Status) Descriptor() ([]byte, []int)
- func (m *Status) GetCode() string
- func (m *Status) GetReason() string
- func (*Status) ProtoMessage()
- func (m *Status) Reset()
- func (m *Status) String() string
- func (m *Status) XXX_DiscardUnknown()
- func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Status) XXX_Merge(src proto.Message)
- func (m *Status) XXX_Size() int
- func (m *Status) XXX_Unmarshal(b []byte) error
- type Version
- func (*Version) Descriptor() ([]byte, []int)
- func (m *Version) GetValue() string
- func (*Version) ProtoMessage()
- func (m *Version) Reset()
- func (m *Version) String() string
- func (m *Version) XXX_DiscardUnknown()
- func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Version) XXX_Merge(src proto.Message)
- func (m *Version) XXX_Size() int
- func (m *Version) XXX_Unmarshal(b []byte) error
- 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 = newError("Header too long.")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Settings for authenticating requests. If not set, client side will not send authenication 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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Config) Descriptor ¶
func (*Config) GetRequest ¶
func (m *Config) GetRequest() *RequestConfig
func (*Config) GetResponse ¶
func (m *Config) GetResponse() *ResponseConfig
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) XXX_DiscardUnknown ¶ added in v3.23.1
func (m *Config) XXX_DiscardUnknown()
func (*Config) XXX_Marshal ¶ added in v3.23.1
func (*Config) XXX_Unmarshal ¶ added in v3.23.1
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Header) Descriptor ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) XXX_DiscardUnknown ¶ added in v3.23.1
func (m *Header) XXX_DiscardUnknown()
func (*Header) XXX_Marshal ¶ added in v3.23.1
func (*Header) XXX_Unmarshal ¶ added in v3.23.1
type HeaderReader ¶
type HeaderReader struct { }
type HeaderWriter ¶
type HeaderWriter struct {
// contains filtered or unexported fields
}
func NewHeaderWriter ¶
func NewHeaderWriter(header *buf.Buffer) *HeaderWriter
type HttpAuthenticator ¶
type HttpAuthenticator struct {
// contains filtered or unexported fields
}
func NewHttpAuthenticator ¶
func NewHttpAuthenticator(ctx context.Context, config *Config) (HttpAuthenticator, error)
func (HttpAuthenticator) GetClientWriter ¶
func (a HttpAuthenticator) GetClientWriter() *HeaderWriter
func (HttpAuthenticator) GetServerWriter ¶
func (a HttpAuthenticator) GetServerWriter() *HeaderWriter
type HttpConn ¶
func NewHttpConn ¶
type Method ¶
type Method struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
HTTP method. Default value "GET".
func (*Method) Descriptor ¶
func (*Method) ProtoMessage ¶
func (*Method) ProtoMessage()
func (*Method) XXX_DiscardUnknown ¶ added in v3.23.1
func (m *Method) XXX_DiscardUnknown()
func (*Method) XXX_Marshal ¶ added in v3.23.1
func (*Method) XXX_Unmarshal ¶ added in v3.23.1
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RequestConfig) Descriptor ¶
func (*RequestConfig) Descriptor() ([]byte, []int)
func (*RequestConfig) GetFullVersion ¶
func (v *RequestConfig) GetFullVersion() string
func (*RequestConfig) GetHeader ¶
func (m *RequestConfig) GetHeader() []*Header
func (*RequestConfig) GetMethod ¶
func (m *RequestConfig) GetMethod() *Method
func (*RequestConfig) GetMethodValue ¶
func (v *RequestConfig) GetMethodValue() string
func (*RequestConfig) GetUri ¶
func (m *RequestConfig) GetUri() []string
func (*RequestConfig) GetVersion ¶
func (m *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) Reset ¶
func (m *RequestConfig) Reset()
func (*RequestConfig) String ¶
func (m *RequestConfig) String() string
func (*RequestConfig) XXX_DiscardUnknown ¶ added in v3.23.1
func (m *RequestConfig) XXX_DiscardUnknown()
func (*RequestConfig) XXX_Marshal ¶ added in v3.23.1
func (m *RequestConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RequestConfig) XXX_Merge ¶ added in v3.23.1
func (m *RequestConfig) XXX_Merge(src proto.Message)
func (*RequestConfig) XXX_Size ¶ added in v3.23.1
func (m *RequestConfig) XXX_Size() int
func (*RequestConfig) XXX_Unmarshal ¶ added in v3.23.1
func (m *RequestConfig) XXX_Unmarshal(b []byte) error
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ResponseConfig) Descriptor ¶
func (*ResponseConfig) Descriptor() ([]byte, []int)
func (*ResponseConfig) GetFullVersion ¶
func (v *ResponseConfig) GetFullVersion() string
func (*ResponseConfig) GetHeader ¶
func (m *ResponseConfig) GetHeader() []*Header
func (*ResponseConfig) GetStatus ¶
func (m *ResponseConfig) GetStatus() *Status
func (*ResponseConfig) GetStatusValue ¶
func (v *ResponseConfig) GetStatusValue() *Status
func (*ResponseConfig) GetVersion ¶
func (m *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) Reset ¶
func (m *ResponseConfig) Reset()
func (*ResponseConfig) String ¶
func (m *ResponseConfig) String() string
func (*ResponseConfig) XXX_DiscardUnknown ¶ added in v3.23.1
func (m *ResponseConfig) XXX_DiscardUnknown()
func (*ResponseConfig) XXX_Marshal ¶ added in v3.23.1
func (m *ResponseConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ResponseConfig) XXX_Merge ¶ added in v3.23.1
func (m *ResponseConfig) XXX_Merge(src proto.Message)
func (*ResponseConfig) XXX_Size ¶ added in v3.23.1
func (m *ResponseConfig) XXX_Size() int
func (*ResponseConfig) XXX_Unmarshal ¶ added in v3.23.1
func (m *ResponseConfig) XXX_Unmarshal(b []byte) error
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Status) Descriptor ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) XXX_DiscardUnknown ¶ added in v3.23.1
func (m *Status) XXX_DiscardUnknown()
func (*Status) XXX_Marshal ¶ added in v3.23.1
func (*Status) XXX_Unmarshal ¶ added in v3.23.1
type Version ¶
type Version struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
HTTP version. Default value "1.1".
func (*Version) Descriptor ¶
func (*Version) ProtoMessage ¶
func (*Version) ProtoMessage()
func (*Version) XXX_DiscardUnknown ¶ added in v3.23.1
func (m *Version) XXX_DiscardUnknown()
func (*Version) XXX_Marshal ¶ added in v3.23.1
func (*Version) XXX_Unmarshal ¶ added in v3.23.1
Click to show internal directories.
Click to hide internal directories.