Documentation ¶
Index ¶
- Variables
- func ContextWithOperators(ctx context.Context, ops ...courier.IOperator) context.Context
- func ContextWithRequest(ctx context.Context, req *http.Request) context.Context
- func ContextWithServiceName(ctx context.Context, serverName string) context.Context
- func CreateHttpHandler(s *ServeHTTP, ops ...courier.IOperator) httprouter.Handle
- func GetClientIP(r *http.Request) string
- func GetLongConnClient(timeout time.Duration) *http.Client
- func GetOperators(ctx context.Context) []courier.IOperator
- func GetParams(path string, url string) (params httprouter.Params, err error)
- func GetRequest(ctx context.Context) *http.Request
- func GetShortConnClient(timeout time.Duration) *http.Client
- func HttpStatusOK(code int) bool
- func MarshalOperator(r *http.Request, operator courier.IOperator) (err error)
- func PayloadMarshal(payload interface{}) ([]byte, error)
- func PayloadUnmarshal(data []byte, payload interface{}) error
- type File
- type HttpRequest
- type IBytesGetter
- type IContentType
- type IHttpRequestTransformer
- type IMethod
- type IPath
- type IStatus
- type IWebSocket
- type Listener
- type Listeners
- type Msg
- type ParameterValuesGetter
- type ResponseWriter
- type ServeHTTP
- type TransportWrapper
- type TypeAndListener
- type WSClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ContextKeyServerName = uuid.New().String() ContextKeyRequest = uuid.New().String() ContextKeyOperators = uuid.New().String() )
View Source
var ProjectRef = os.Getenv("PROJECT_REF")
View Source
var RxHttpRouterPath = regexp.MustCompile("/:([^/]+)")
Functions ¶
func ContextWithOperators ¶
func ContextWithRequest ¶
func ContextWithServiceName ¶
func CreateHttpHandler ¶
func CreateHttpHandler(s *ServeHTTP, ops ...courier.IOperator) httprouter.Handle
func GetClientIP ¶
func HttpStatusOK ¶
func MarshalOperator ¶
func PayloadMarshal ¶
func PayloadUnmarshal ¶
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
swagger:strfmt binary
func (*File) ContentType ¶
type HttpRequest ¶
type HttpRequest struct { BaseURL string Method string URI string ID string Metadata courier.Metadata Timeout time.Duration Req interface{} WrapTransport TransportWrapper }
func (*HttpRequest) Do ¶
func (httpRequest *HttpRequest) Do() (result courier.Result)
type IBytesGetter ¶
type IBytesGetter interface {
Bytes() []byte
}
type IContentType ¶
type IContentType interface {
ContentType() string
}
type IHttpRequestTransformer ¶
type IWebSocket ¶
type ParameterValuesGetter ¶
type ParameterValuesGetter struct { *transform.ParameterValuesGetter Params *httprouter.Params }
func (*ParameterValuesGetter) Param ¶
func (getter *ParameterValuesGetter) Param(name string) string
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter Code int // contains filtered or unexported fields }
func (*ResponseWriter) Hijack ¶
func (w *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*ResponseWriter) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(code int)
type ServeHTTP ¶
type ServeHTTP struct { Name string IP string Port int SwaggerPath string WriteTimeout time.Duration ReadTimeout time.Duration WithCORS bool // contains filtered or unexported fields }
func (ServeHTTP) DockerDefaults ¶
func (s ServeHTTP) DockerDefaults() conf.DockerDefaults
func (ServeHTTP) MarshalDefaults ¶
func (s ServeHTTP) MarshalDefaults(v interface{})
type TransportWrapper ¶
type TransportWrapper func(rt http.RoundTripper) http.RoundTripper
type TypeAndListener ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.