ssac

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeqGet      = "get"
	SeqPost     = "post"
	SeqPut      = "put"
	SeqDelete   = "delete"
	SeqEmpty    = "empty"
	SeqExists   = "exists"
	SeqState    = "state"
	SeqAuth     = "auth"
	SeqCall     = "call"
	SeqPublish  = "publish"
	SeqResponse = "response"
)

sequence 타입 상수

Variables

Functions

func IsLiteral

func IsLiteral(s string) bool

IsLiteral checks if a string is a Go literal value (not a variable reference). Recognizes: numeric (42, -1, 3.14), boolean (true, false), nil.

Types

type Arg

type Arg struct {
	Source  string // "request", 변수명, 또는 "" (리터럴)
	Field   string // "CourseID", "ID" 등
	Literal string // "cancelled" 등 (Source가 ""일 때)
}

Arg는 함수 호출 인자다.

type ParamInfo

type ParamInfo struct {
	TypeName string // "OnOrderCompletedMessage"
	VarName  string // "message"
}

ParamInfo는 함수 파라미터 정보다.

type Result

type Result struct {
	Type    string // "Course", "Reservation" (내부 타입)
	Var     string // "course", "reservations"
	Wrapper string // "Page", "Cursor", "" (제네릭 래퍼)
}

Result는 결과 바인딩이다.

type Sequence

type Sequence struct {
	Type string // "get", "post", "put", "delete", "empty", "exists", "state", "auth", "call", "response"

	// get/post/put/delete/call 공통: 함수 호출
	Package string // "session" (패키지 접두사, 없으면 "")
	Model   string // "Course.FindByID" 또는 "auth.VerifyPassword"
	Args    []Arg  // 호출 인자

	// get/post/call: 대입
	Result *Result // 결과 바인딩 (nil이면 대입 없음)

	// empty/exists: guard
	Target string // "course" 또는 "course.InstructorID"

	// state: 상태 전이
	DiagramID  string            // "reservation"
	Inputs     map[string]string // {status: "reservation.Status"}
	Transition string            // "cancel"

	// publish: 이벤트 발행
	Topic   string            // "order.completed"
	Options map[string]string // {delay: "1800"} (선택)

	// auth: 권한 검사
	Action   string // "delete"
	Resource string // "project"

	// response: 필드 매핑
	Fields map[string]string // {course: "course", instructor_name: "instructor.Name"}

	// 공통
	Message      string // 에러 메시지
	ErrStatus    int    // 에러 HTTP 상태 코드 (0이면 타입별 기본값: @call→500, @empty→404, @exists→409, @state→409, @auth→403)
	SuppressWarn bool   // @type! — WARNING 억제
}

Sequence는 하나의 시퀀스 라인이다.

type ServiceFunc

type ServiceFunc struct {
	Name      string         // 함수명 (e.g. "GetCourse")
	FileName  string         // 원본 파일명
	Feature   string         // feature 폴더명 (e.g. "auth", 없으면 "")
	Sequences []Sequence     // 시퀀스 목록
	Imports   []string       // Go import 경로
	Subscribe *SubscribeInfo // nil이면 HTTP 트리거
	Param     *ParamInfo     // 함수 파라미터 (subscribe 함수용)
	Structs   []StructInfo   // .ssac 파일에 선언된 Go struct 목록
}

ServiceFunc는 하나의 서비스 함수 선언이다.

func ParseDir

func ParseDir(dir string) ([]ServiceFunc, []diagnostic.Diagnostic)

ParseDir은 디렉토리 내 모든 .ssac 파일을 재귀 탐색하여 []ServiceFunc를 반환한다.

func ParseFile

func ParseFile(path string) ([]ServiceFunc, []diagnostic.Diagnostic)

ParseFile은 단일 .ssac 파일을 파싱하여 []ServiceFunc를 반환한다.

type StructField

type StructField struct {
	Name string // "OrderID"
	Type string // "int64"
}

StructField는 struct 필드 정보다.

type StructInfo

type StructInfo struct {
	Name   string // "OnOrderCompletedMessage"
	Fields []StructField
}

StructInfo는 .ssac 파일에 선언된 Go struct 정보다.

type SubscribeInfo

type SubscribeInfo struct {
	Topic       string // "order.completed"
	MessageType string // "OnOrderCompletedMessage"
}

SubscribeInfo는 큐 구독 트리거 정보다.

Jump to

Keyboard shortcuts

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