starter/pkg/restyx/basic.go
2026-03-28 19:29:40 +08:00

30 lines
490 B
Go

package restyx
import (
"bufio"
"context"
)
type Basic struct {
LogID string `json:"log_id"`
}
func (b *Basic) SetLogID(logID string) {
b.LogID = logID
}
type SpecialResponse struct {
Headers string `json:"header"`
Data string `json:"data"`
}
func (r *SpecialResponse) SetData(data string) {
r.Data = data
}
func (r *SpecialResponse) SetHeaders(headers string) {
r.Headers = headers
}
type StreamFunc func(ctx context.Context, scanner *bufio.Scanner) (interface{}, error)