appcontext

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadHandler

type ReadHandler func(conn netpoll.Connection, rw *bufio.ReadWriter) error

ReadHandler is a function type for handling custom connection reads (e.g., WebSocket). ReadHandler는 사용자 정의 연결 읽기(예: WebSocket)를 처리하기 위한 함수 타입입니다.

type RequestContext

type RequestContext struct {
	// contains filtered or unexported fields
}

RequestContext holds all necessary information during the lifecycle of an HTTP request. RequestContext는 HTTP 요청의 전체 생명주기 동안 필요한 모든 정보를 담습니다.

func NewRequestContext

func NewRequestContext(conn netpoll.Connection, parent context.Context, reader *bufio.Reader, writer *bufio.Writer) *RequestContext

NewRequestContext retrieves and initializes a RequestContext from the pool. NewRequestContext는 풀에서 RequestContext를 가져와 초기화합니다.

func (*RequestContext) Conn

func (c *RequestContext) Conn() netpoll.Connection

Conn returns the netpoll.Connection associated with this context. Conn은 이 컨텍스트와 연결된 netpoll.Connection을 반환합니다.

func (*RequestContext) GetReader

func (c *RequestContext) GetReader() *bufio.Reader

GetReader returns the reusable bufio.Reader for the connection. GetReader는 연결에 대한 재사용 가능한 bufio.Reader를 반환합니다.

func (*RequestContext) GetWriter

func (c *RequestContext) GetWriter() *bufio.Writer

GetWriter returns the reusable bufio.Writer for the connection. GetWriter는 연결에 대한 재사용 가능한 bufio.Writer를 반환합니다.

func (*RequestContext) Release

func (c *RequestContext) Release()

Release returns the RequestContext to the pool for reuse. Release는 RequestContext를 풀에 반환하여 재사용할 수 있도록 합니다.

func (*RequestContext) RemoteAddrString

func (c *RequestContext) RemoteAddrString() string

func (*RequestContext) Req

func (c *RequestContext) Req() context.Context

Req returns the parent context for the request. Req는 요청에 대한 부모 컨텍스트를 반환합니다.

func (*RequestContext) SetOnSetReadHandler

func (c *RequestContext) SetOnSetReadHandler(cb func(ReadHandler))

SetOnSetReadHandler sets the callback to be called when SetReadHandler is invoked. SetOnSetReadHandler는 SetReadHandler가 호출될 때 실행될 콜백을 설정합니다.

func (*RequestContext) SetReadHandler

func (c *RequestContext) SetReadHandler(h ReadHandler)

SetReadHandler sets the custom read handler for the connection. SetReadHandler는 연결에 대한 사용자 정의 읽기 핸들러를 설정합니다.

func (*RequestContext) SetRemoteAddrString

func (c *RequestContext) SetRemoteAddrString(addr string)

Jump to

Keyboard shortcuts

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