api_service

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Slug         string `json:"slug" binding:"required,max=64"`
	Name         string `json:"name" binding:"required,max=128"`
	Description  string `json:"description"`
	PricePerCall int64  `json:"price_per_call"`
	Status       *int   `json:"status"`
}

type Handler

type Handler struct {
	App       app.Application
	Publisher ServicePublisher
}

func (*Handler) Create

func (*Handler) Delete

func (h *Handler) Delete(c *app.Context, req IDRequest) (api.StatusResponse, error)

func (*Handler) Get

func (h *Handler) Get(c *app.Context, req IDRequest) (models.APIService, error)

func (*Handler) List

func (*Handler) Update

func (h *Handler) Update(c *app.Context, req UpdateRequest) (api.StatusResponse, error)

type IDRequest

type IDRequest struct {
	ID string `uri:"id" binding:"required"`
}

type ListRequest

type ListRequest struct {
	api.PaginationQuery
	Search string `form:"search"`
	Status *int   `form:"status"`
}

type ServicePublisher

type ServicePublisher interface {
	PublishService(context.Context, string, models.APIService) error
}

type UpdateRequest

type UpdateRequest struct {
	ID     string         `uri:"id" binding:"required"`
	Fields map[string]any `json:"-"`
}

func (*UpdateRequest) SetBodyMap

func (r *UpdateRequest) SetBodyMap(v map[string]any)

Jump to

Keyboard shortcuts

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