Documentation ¶
Index ¶
- Variables
- type ModifyRequestHookFunc
- type NatsTransport
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (r *Request) FromHTTP(req *http.Request) error
- func (x *Request) GetBody() []byte
- func (x *Request) GetHeader() map[string]*Values
- func (x *Request) GetHost() string
- func (x *Request) GetMethod() string
- func (x *Request) GetProto() string
- func (x *Request) GetRemoteAddr() string
- func (x *Request) GetScheme() string
- func (x *Request) GetURL() string
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetBody() []byte
- func (x *Response) GetError() string
- func (x *Response) GetHeader() map[string]*Values
- func (x *Response) GetStatusCode() int32
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (resp *Response) ReadFrom(responseData []byte) error
- func (x *Response) Reset()
- func (x *Response) String() string
- func (resp *Response) ToHTTPResponse(r *http.Request) (*http.Response, error)
- type SubjectResolveFunc
- type Values
Constants ¶
This section is empty.
Variables ¶
View Source
var File_protobuf_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type ModifyRequestHookFunc ¶
ModifyRequestHookFunc is the hook to modify Request struct (protobuf)
type NatsTransport ¶
type NatsTransport struct { // NatsConnection connection to NATS server NatsConnection *nats.Conn // Subject NATS subject to push wrapped HTTP request on Subject string // SubjectResolver used only if Subject is not specified SubjectResolver SubjectResolveFunc // ModifyRequestHook calls after Request struct parsed from HTTP and before sent to NATS ModifyRequestHook ModifyRequestHookFunc // Timeout NATS request timeout Timeout time.Duration }
type Request ¶
type Request struct { Proto string `protobuf:"bytes,1,opt,name=Proto,proto3" json:"Proto,omitempty"` Scheme string `protobuf:"bytes,2,opt,name=Scheme,proto3" json:"Scheme,omitempty"` Host string `protobuf:"bytes,3,opt,name=Host,proto3" json:"Host,omitempty"` URL string `protobuf:"bytes,4,opt,name=URL,proto3" json:"URL,omitempty"` Method string `protobuf:"bytes,5,opt,name=Method,proto3" json:"Method,omitempty"` RemoteAddr string `protobuf:"bytes,6,opt,name=RemoteAddr,proto3" json:"RemoteAddr,omitempty"` Body []byte `protobuf:"bytes,7,opt,name=Body,proto3" json:"Body,omitempty"` Header map[string]*Values `` /* 153-byte string literal not displayed */ // contains filtered or unexported fields }
func NewRequest ¶
func NewRequest() *Request
func (*Request) Descriptor
deprecated
func (*Request) GetRemoteAddr ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { StatusCode int32 `protobuf:"varint,1,opt,name=StatusCode,proto3" json:"StatusCode,omitempty"` Header map[string]*Values `` /* 153-byte string literal not displayed */ Body []byte `protobuf:"bytes,3,opt,name=Body,proto3" json:"Body,omitempty"` Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"Error,omitempty"` // contains filtered or unexported fields }
func NewResponse ¶
func NewResponse() *Response
NewResponse creates blank initialized Response object.
func (*Response) Descriptor
deprecated
func (*Response) GetStatusCode ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type SubjectResolveFunc ¶
SubjectResolveFunc resolves the NATS subject (based on http.Request struct)
type Values ¶
type Values struct { Arr []string `protobuf:"bytes,1,rep,name=arr,proto3" json:"arr,omitempty"` // contains filtered or unexported fields }
func (*Values) Descriptor
deprecated
func (*Values) ProtoMessage ¶
func (*Values) ProtoMessage()
func (*Values) ProtoReflect ¶
func (x *Values) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.