source

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(
	sourceManager *sourcemanager.SourceManager,
) (*Handler, error)

func (*Handler) CreateSource

func (h *Handler) CreateSource() http.HandlerFunc

@Id createSource @Summary Create source @Description Create a new source @Tags source @Accept json @Produce json @Param source body request.CreateSourceRequest true "Created source" @Success 200 {object} handler.Response{data=entity.Source} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/sources [post]

func (*Handler) DeleteSource

func (h *Handler) DeleteSource() http.HandlerFunc

@Id deleteSource @Summary Delete source @Description Delete specified source by ID @Tags source @Produce json @Param sourceID path int true "Source ID" @Success 200 {object} handler.Response{data=string} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/sources/{sourceID} [delete]

func (*Handler) GetSource

func (h *Handler) GetSource() http.HandlerFunc

@Id getSource @Summary Get source @Description Get source information by source ID @Tags source @Produce json @Param sourceID path int true "Source ID" @Success 200 {object} handler.Response{data=entity.Source} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/sources/{sourceID} [get]

func (*Handler) ListSources

func (h *Handler) ListSources() http.HandlerFunc

@Id listSource @Summary List source @Description List source information by source ID @Tags source @Produce json @Param sourceName query string false "Source name to filter source list by. Default to all sources." @Param page query uint false "The current page to fetch. Default to 1" @Param pageSize query uint false "The size of the page. Default to 10" @Param sortBy query string false "Which field to sort the list by. Default to id" @Param ascending query bool false "Whether to sort the list in ascending order. Default to false" @Success 200 {object} handler.Response{data=response.PaginatedSourceResponse} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/sources [get]

func (*Handler) UpdateSource

func (h *Handler) UpdateSource() http.HandlerFunc

@Id updateSource @Summary Update source @Description Update the specified source @Tags source @Accept json @Produce json @Param sourceID path int true "Source ID" @Param source body request.UpdateSourceRequest true "Updated source" @Success 200 {object} handler.Response{data=entity.Source} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/sources/{sourceID} [put]

type SourceRequestParams

type SourceRequestParams struct {
	SourceID uint
}

Jump to

Keyboard shortcuts

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