context

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSid

func GetSid(ctx context.Context) string

func WithSid

func WithSid(ctx context.Context, sid string) context.Context

Types

type Body

type Body interface {
	Len() int
	io.Reader
	Scan(obj interface{}) error
	Bytes() []byte
}

type Context

type Context interface {
	GetImpl() interface{}
	ServerType() string
	ServerName() string
	ResetContext(ctx context.Context)
	Context() context.Context
	Header(key string) string
	Request() Request
	Bind(interface{}) error
	Response() Response
	Meta() map[string]interface{}
	Log() log.Logger
	Close()
}
type Header interface {
	Len() int
	IsEmpty() bool
	Get(name string) string
	Set(name, val string)
	Values() map[string]string
	Keys() []string
}

type MapHeader

type MapHeader xtypes.SMap

func (MapHeader) Values

func (m MapHeader) Values() map[string]string

type Path

type Path interface {
	GetURL() *url.URL
	FullPath() string
	Params() xtypes.SMap
}

type Query

type Query interface {
	Get(name string) string
	Values() xtypes.SMap
	ScanTo(obj interface{}) error
	String() string
	GetValues() url.Values
}

type Request

type Request interface {
	GetMethod() string
	GetClientIP() string
	RequestID() string
	ContentType() string
	Header() Header
	GetHeader(key string) string
	SetHeader(key, val string)
	Path() Path
	Query() Query
	Body() Body
	GetImpl() interface{}
}

type Response

type Response interface {
	Status(int)
	GetStatusCode() int
	Header(key, val string)
	Write(obj interface{}) error
	WriteBytes([]byte) error
	ContentType() string
	ResponseBytes() []byte
	Redirect(statusCode int, location string)
}

type UserInfo

type UserInfo interface {
	IsValid() bool
}

Jump to

Keyboard shortcuts

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