spine

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 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 App

type App interface {
	// 컴포넌트 타입 선언
	Register(components ...Component)
	// 생성자 선언
	Constructor(constructors ...any)
	// 라우트 선언
	Route(method string, path string, handler any)
	// 실행
	Run(address string) error
}

func New

func New() App

type Component

type Component struct {
	Type reflect.Type
}

컴포넌트는 컨테이너에 의해 등록되는 객체입니다. 컴포넌트 구조체는 싱글톤 오브젝트의 루트입니다.

func ComponentOf

func ComponentOf(ptr any) Component

ComponentOf는 주어진 값을 컨테이너가 관리하는 컴포넌트로 선언합니다.

type Context

type Context = core.Context

Context는 하나의 요청 실행 단위를 표현하는 공통 컨텍스트

type Interceptor

type Interceptor interface {
	/*
		Around는 실행을 감싸는 유일한 진입점

		next를 호출하면 다음 Interceptor 또는 최종 Handler 실행으로 제어가 전달된다.
		next를 호출하지 않으면 실행은 중단된다.
	*/
	Around(ctx Context, next Next) error
}

Interceptor는 실행 흐름을 감사는 횡단 관심사 처리 계약

Interceptor는 Handler 호출 전후에 개입할 수 있으며, 반드시 next를 호출해야 다음 단계로 실행이 전달됨

실행 순서, 중단 여부, 전후 처리의 책임은 Pipeline이 아닌 Interceptor 구현체에 있다.

type Next

type Next func() error

Next는 다음 실행 단계로 제어를 전달하는 함수입니다.

Directories

Path Synopsis
cmd
demo command
internal

Jump to

Keyboard shortcuts

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