runtime

package
v0.0.0-...-225f367 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackwardResponseMessage = backwardResponseMessage

BackwardResponseMessage backwards message "resp" from REST client to client API.

View Source
var ForwardResponseMessage = forwardResponseMessage

ForwardResponseMessage forwards the message "resp" from server to REST client.

View Source
var HTTPError = defaultHTTPErrorHandler

HTTPError eplies to the request with an error.

View Source
var HideDetails bool

HideDetails represents whether hide the error details or not.

Functions

func ClientIPFromContext

func ClientIPFromContext(ctx context.Context) (string, bool)

ClientIPFromContext returns the remote client ip in ctx if it exists.

func GetRequestHeader

func GetRequestHeader(ctx context.Context) (http.Header, bool)

GetRequestHeader returns request header attached in the context.

func GetResponseHeader

func GetResponseHeader(ctx context.Context) (http.Header, bool)

GetResponseHeader returns response header attached in the context.

func NewRequestHeaderContext

func NewRequestHeaderContext(ctx context.Context, header http.Header) context.Context

NewRequestHeaderContext creates a new context with request header attached.

func NewResponseHeaderContext

func NewResponseHeaderContext(ctx context.Context, header http.Header) context.Context

NewResponseHeaderContext creates a new context with response header attached.

func SendResponseHeader

func SendResponseHeader(ctx context.Context, header http.Header)

SendResponseHeader add reponse header into the context.

Types

type Context

type Context struct {
	*gin.Context
}

Context represents a runtime context

func NewContext

func NewContext(c *gin.Context) *Context

NewContext new context

func (*Context) Deadline

func (c *Context) Deadline() (deadline time.Time, ok bool)

func (*Context) Done

func (c *Context) Done() <-chan struct{}

func (*Context) Err

func (c *Context) Err() error

func (*Context) Value

func (c *Context) Value(key interface{}) interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL