api_backend

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateInTx

func CreateInTx(ctx dao.Context, apiServiceID uint, input CreateInput) (models.APIBackend, error)

Types

type CreateInput

type CreateInput struct {
	Name string `json:"name" binding:"required,max=64"`
}

type CreateRequest

type CreateRequest struct {
	APIServiceID uint `json:"api_service_id" binding:"required"`
	CreateInput
}

type Handler

type Handler struct {
	App       app.Application
	Publisher UpstreamPublisher
}

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) (ManagementResponse, 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
	APIServiceID *uint  `form:"api_service_id"`
	Search       string `form:"search"`
}

type ManagementResponse

type ManagementResponse struct {
	models.APIBackend
	RouteCount           int64    `json:"route_count"`
	UpstreamCount        int64    `json:"upstream_count"`
	EnabledUpstreamCount int64    `json:"enabled_upstream_count"`
	EndpointHosts        []string `json:"endpoint_hosts"`
}

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)

type UpstreamPublisher

type UpstreamPublisher interface {
	PublishUpstream(context.Context, string, models.APIUpstream) error
}

Jump to

Keyboard shortcuts

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