Documentation ¶
Index ¶
- func LoggingHandler(h http.Handler) http.Handler
- type CreateDatabaseInput
- type CreateDatabaseOutput
- type CreateDatabaseStackInput
- type Database
- type DatabaseOutput
- type DatabaseStackInput
- type DatabasesOutput
- type Option
- type PingOutput
- type PopDatabaseStackElementOutput
- type PushDatabaseStackElementInput
- type Service
- func (s *Service) AddRoutes(api huma.API)
- func (s *Service) CreateDatabaseHandler(_ context.Context, input *CreateDatabaseInput) (*CreateDatabaseOutput, error)
- func (s *Service) CreateDatabaseStackHandler(_ context.Context, input *CreateDatabaseStackInput) (*StackOutput, error)
- func (s *Service) DeleteDatabaseHandler(_ context.Context, input *SingleDatabaseInput) (*struct{}, error)
- func (s *Service) DeleteDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*struct{}, error)
- func (s *Service) FlushDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*StackOutput, error)
- func (s *Service) ListDatabaseStacksHandler(_ context.Context, input *StackInput) (*StacksOutput, error)
- func (s *Service) ListDatabasesHandler(_ context.Context, _ *struct{}) (*DatabasesOutput, error)
- func (s *Service) LoadToFile() error
- func (s *Service) OpenAPI(openapi string) []byte
- func (s *Service) PeekDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*StackElement, error)
- func (s *Service) PopDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*PopDatabaseStackElementOutput, error)
- func (s *Service) Port() int32
- func (s *Service) PushDatabaseStackHandler(_ context.Context, input *PushDatabaseStackElementInput) (*StackElement, error)
- func (s *Service) SaveToFile() error
- func (s *Service) ShowDatabaseHandler(_ context.Context, input *SingleDatabaseInput) (*DatabaseOutput, error)
- func (s *Service) ShowDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*StackOutput, error)
- func (s *Service) Shutdown(ctx context.Context) error
- func (s *Service) Start() error
- func (s *Service) StatusHandler(_ context.Context, _ *struct{}) (*StatusOutput, error)
- type SingleDatabaseInput
- type Stack
- type StackElement
- type StackInput
- type StackOutput
- type StacksOutput
- type StatusBody
- type StatusOutput
- type URLParamDatabaseID
- type URLParamStackID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateDatabaseInput ¶
type CreateDatabaseInput struct {
Name string `minLength:"7" query:"name" required:"true"`
}
type CreateDatabaseOutput ¶
type CreateDatabaseOutput struct {
Body Database
}
type CreateDatabaseStackInput ¶
type CreateDatabaseStackInput struct { URLParamDatabaseID Name string `minLength:"7" query:"name" required:"true"` }
type DatabaseOutput ¶
type DatabaseOutput struct {
Body Database
}
type DatabaseStackInput ¶
type DatabaseStackInput struct { URLParamDatabaseID URLParamStackID }
type DatabasesOutput ¶
type Option ¶ added in v0.0.7
type Option func(*Service)
func WithBuildInfo ¶ added in v0.1.0
func WithPersistDB ¶ added in v0.0.7
func WithRepoFile ¶ added in v0.1.0
func WithSecure ¶ added in v0.1.0
type PingOutput ¶
type PingOutput struct {
Body []byte `contentType:"text/plain"`
}
func PingHandler ¶
func PingHandler(_ context.Context, _ *struct{}) (*PingOutput, error)
type PushDatabaseStackElementInput ¶
type PushDatabaseStackElementInput struct { Body struct { Element any `json:"element"` } DatabaseStackInput }
type Service ¶
type Service struct { Repository *repository.Repository API huma.API // contains filtered or unexported fields }
func (*Service) CreateDatabaseHandler ¶
func (s *Service) CreateDatabaseHandler(_ context.Context, input *CreateDatabaseInput) (*CreateDatabaseOutput, error)
func (*Service) CreateDatabaseStackHandler ¶
func (s *Service) CreateDatabaseStackHandler(_ context.Context, input *CreateDatabaseStackInput) (*StackOutput, error)
func (*Service) DeleteDatabaseHandler ¶
func (s *Service) DeleteDatabaseHandler(_ context.Context, input *SingleDatabaseInput) (*struct{}, error)
func (*Service) DeleteDatabaseStackHandler ¶
func (s *Service) DeleteDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*struct{}, error)
func (*Service) FlushDatabaseStackHandler ¶
func (s *Service) FlushDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*StackOutput, error)
func (*Service) ListDatabaseStacksHandler ¶
func (s *Service) ListDatabaseStacksHandler(_ context.Context, input *StackInput) (*StacksOutput, error)
func (*Service) ListDatabasesHandler ¶
func (s *Service) ListDatabasesHandler(_ context.Context, _ *struct{}) (*DatabasesOutput, error)
func (*Service) LoadToFile ¶ added in v0.1.0
func (*Service) OpenAPI ¶ added in v0.0.6
OpenAPI return the OpenAPI spec as a string in the requested version.
func (*Service) PeekDatabaseStackHandler ¶
func (s *Service) PeekDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*StackElement, error)
func (*Service) PopDatabaseStackHandler ¶
func (s *Service) PopDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*PopDatabaseStackElementOutput, error)
func (*Service) PushDatabaseStackHandler ¶
func (s *Service) PushDatabaseStackHandler(_ context.Context, input *PushDatabaseStackElementInput) (*StackElement, error)
func (*Service) SaveToFile ¶ added in v0.1.0
func (*Service) ShowDatabaseHandler ¶
func (s *Service) ShowDatabaseHandler(_ context.Context, input *SingleDatabaseInput) (*DatabaseOutput, error)
func (*Service) ShowDatabaseStackHandler ¶
func (s *Service) ShowDatabaseStackHandler(_ context.Context, input *DatabaseStackInput) (*StackOutput, error)
func (*Service) StatusHandler ¶
func (s *Service) StatusHandler(_ context.Context, _ *struct{}) (*StatusOutput, error)
type SingleDatabaseInput ¶
type SingleDatabaseInput struct {
URLParamDatabaseID
}
type StackElement ¶
type StackElement struct { Body struct { Element any `json:"element"` } }
type StackInput ¶
type StackInput struct { URLParamDatabaseID KV bool `default:"false" query:"kv"` }
type StackOutput ¶
type StackOutput struct {
Body Stack `json:"stack"`
}
type StacksOutput ¶
type StacksOutput struct { Body struct { Stacks any `json:"stacks"` } }
type StatusBody ¶
type StatusBody struct { StartedAt time.Time `json:"started_at" yaml:"startedAt"` Code string `json:"status" yaml:"code"` Version string `json:"version" yaml:"version"` GoVersion string `json:"go_version" yaml:"goVersion"` Host string `json:"host" yaml:"host"` MemoryAlloc string `json:"memory_alloc" yaml:"memoryAlloc"` RunningFor float64 `json:"running_for" yaml:"runningFor"` PID int `json:"pid" yaml:"pid"` NumberGoroutines int `json:"number_goroutines" yaml:"numberGoroutines"` }
type StatusOutput ¶
type StatusOutput struct {
Body StatusBody
}
type URLParamDatabaseID ¶
type URLParamDatabaseID struct {
DatabaseID string `doc:"can be the database ID or name" path:"database"`
}
type URLParamStackID ¶
type URLParamStackID struct {
StackID string `doc:"can be the stack ID or name" path:"stack"`
}
Click to show internal directories.
Click to hide internal directories.