Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type Context ¶
type Context interface {
// 경로 변수 값을 반환
Param(name string) string
// 쿼리 파라미터 값을 반환
Query(name string) string
// 요청 헤더 값을 반환
Header(name string) string
// 요청 본문을 주어진 구조체로 바인딩
Bind(out any) error
// 요청 범위 데이터 저장
Set(key string, value any)
// 요청 범위 데이터 조회
Get(key string) (any, bool)
}
Context는 하나의 요청 실행 단위를 표현하는 공통 컨텍스트
type Interceptor ¶
type Interceptor interface {
/*
Around는 실행을 감싸는 유일한 진입점
next를 호출하면 다음 Interceptor 또는 최종 Handler 실행으로 제어가 전달된다.
next를 호출하지 않으면 실행은 중단된다.
*/
Around(ctx Context, next Next) error
}
Interceptor는 실행 흐름을 감사는 횡단 관심사 처리 계약
Interceptor는 Handler 호출 전후에 개입할 수 있으며, 반드시 next를 호출해야 다음 단계로 실행이 전달됨
실행 순서, 중단 여부, 전후 처리의 책임은 Pipeline이 아닌 Interceptor 구현체에 있다.
Click to show internal directories.
Click to hide internal directories.