api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageSize = 20
)

Variables

View Source
var (
	MsgNotFound       = "Not found"
	MsgLicenseInvalid = "license missing or expired"
	MsgInavlidUUID    = "Invalid uuid"
)

Functions

func BuildPaginationResponse added in v1.1.0

func BuildPaginationResponse[T any](cursor dao.Cursor[T], url *url.URL) interface{}

func ValidateRequest added in v0.8.0

func ValidateRequest(r *http.Request, defaults map[string]interface{}, target entities.Schema) error

Types

type API

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

func NewAPI

func NewAPI(opts Options, services *services.Services) *API

func (*API) CreateEndpoint

func (api *API) CreateEndpoint(w http.ResponseWriter, r *http.Request)

func (*API) CreateEvent

func (api *API) CreateEvent(w http.ResponseWriter, r *http.Request)

func (*API) CreatePlugin added in v0.2.0

func (api *API) CreatePlugin(w http.ResponseWriter, r *http.Request)

func (*API) CreateSource

func (api *API) CreateSource(w http.ResponseWriter, r *http.Request)

func (*API) CreateWorkspace

func (api *API) CreateWorkspace(w http.ResponseWriter, r *http.Request)

func (*API) DeleteEndpoint

func (api *API) DeleteEndpoint(w http.ResponseWriter, r *http.Request)

func (*API) DeletePlugin added in v0.2.0

func (api *API) DeletePlugin(w http.ResponseWriter, r *http.Request)

func (*API) DeleteSource

func (api *API) DeleteSource(w http.ResponseWriter, r *http.Request)

func (*API) DeleteWorkspace

func (api *API) DeleteWorkspace(w http.ResponseWriter, r *http.Request)

func (*API) Dump added in v0.4.0

func (api *API) Dump(w http.ResponseWriter, r *http.Request)

func (*API) GetAttempt

func (api *API) GetAttempt(w http.ResponseWriter, r *http.Request)

func (*API) GetEndpoint

func (api *API) GetEndpoint(w http.ResponseWriter, r *http.Request)

func (*API) GetEvent

func (api *API) GetEvent(w http.ResponseWriter, r *http.Request)

func (*API) GetLicense added in v1.0.0

func (api *API) GetLicense(w http.ResponseWriter, r *http.Request)

func (*API) GetPlugin added in v0.2.0

func (api *API) GetPlugin(w http.ResponseWriter, r *http.Request)

func (*API) GetSource

func (api *API) GetSource(w http.ResponseWriter, r *http.Request)

func (*API) GetWorkspace

func (api *API) GetWorkspace(w http.ResponseWriter, r *http.Request)

func (*API) Handler

func (api *API) Handler() http.Handler

Handler returns a http.Handler

func (*API) Index

func (api *API) Index(w http.ResponseWriter, r *http.Request)

func (*API) PageAttempt

func (api *API) PageAttempt(w http.ResponseWriter, r *http.Request)

func (*API) PageEndpoint

func (api *API) PageEndpoint(w http.ResponseWriter, r *http.Request)

func (*API) PageEvent

func (api *API) PageEvent(w http.ResponseWriter, r *http.Request)

func (*API) PagePlugin added in v0.2.0

func (api *API) PagePlugin(w http.ResponseWriter, r *http.Request)

func (*API) PageSource

func (api *API) PageSource(w http.ResponseWriter, r *http.Request)

func (*API) PageWorkspace

func (api *API) PageWorkspace(w http.ResponseWriter, r *http.Request)

func (*API) RetryEvent added in v0.2.0

func (api *API) RetryEvent(w http.ResponseWriter, r *http.Request)

func (*API) Sync added in v0.4.0

func (api *API) Sync(w http.ResponseWriter, r *http.Request)

func (*API) UpdateEndpoint

func (api *API) UpdateEndpoint(w http.ResponseWriter, r *http.Request)

func (*API) UpdatePlugin added in v0.2.0

func (api *API) UpdatePlugin(w http.ResponseWriter, r *http.Request)

func (*API) UpdateSource

func (api *API) UpdateSource(w http.ResponseWriter, r *http.Request)

func (*API) UpdateWorkspace

func (api *API) UpdateWorkspace(w http.ResponseWriter, r *http.Request)

type AttemptListParams added in v1.1.0

type AttemptListParams struct {
	ListParams

	CreatedAt      *int64  `form:"created_at"`
	CreatedAtGT    *int64  `form:"created_at[gt]"`
	CreatedAtGTE   *int64  `form:"created_at[gte]"`
	CreatedAtLT    *int64  `form:"created_at[lt]"`
	CreatedAtLTE   *int64  `form:"created_at[lte]"`
	EventId        *string `form:"event_id"`
	EndpointId     *string `form:"endpoint_id"`
	Status         *string `form:"status"`
	AttemptedAt    *int64  `form:"attempted_at"`
	AttemptedAtGT  *int64  `form:"attempted_at[gt]"`
	AttemptedAtGTE *int64  `form:"attempted_at[gte]"`
	AttemptedAtLT  *int64  `form:"attempted_at[lt]"`
	AttemptedAtLTE *int64  `form:"attempted_at[lte]"`
}

func (*AttemptListParams) Query added in v1.1.0

func (p *AttemptListParams) Query() *dao.Query

type CursorPagination added in v1.1.0

type CursorPagination[T any] struct {
	Data []T     `json:"data"`
	Next *string `json:"next"`
	Prev *string `json:"prev"`
}

type EndpointListParams added in v1.1.0

type EndpointListParams struct {
	ListParams

	Name         *string           `form:"name"`
	Enabled      *bool             `form:"enabled"`
	CreatedAt    *int64            `form:"created_at"`
	CreatedAtGT  *int64            `form:"created_at[gt]"`
	CreatedAtGTE *int64            `form:"created_at[gte]"`
	CreatedAtLT  *int64            `form:"created_at[lt]"`
	CreatedAtLTE *int64            `form:"created_at[lte]"`
	Metadata     map[string]string `form:"metadata"`
}

func (*EndpointListParams) Query added in v1.1.0

func (p *EndpointListParams) Query() *dao.Query

type EventListParams added in v1.1.0

type EventListParams struct {
	ListParams

	CreatedAt     *int64  `form:"created_at"`
	CreatedAtGT   *int64  `form:"created_at[gt]"`
	CreatedAtGTE  *int64  `form:"created_at[gte]"`
	CreatedAtLT   *int64  `form:"created_at[lt]"`
	CreatedAtLTE  *int64  `form:"created_at[lte]"`
	EventType     *string `form:"event_type"`
	UniqueId      *string `form:"unique_id"`
	IngestedAt    *int64  `form:"ingested_at"`
	IngestedAtGT  *int64  `form:"ingested_at[gt]"`
	IngestedAtGTE *int64  `form:"ingested_at[gte]"`
	IngestedAtLT  *int64  `form:"ingested_at[lt]"`
	IngestedAtLTE *int64  `form:"ingested_at[lte]"`
}

func (*EventListParams) Query added in v1.1.0

func (p *EventListParams) Query() *dao.Query

type IndexResponse added in v0.8.0

type IndexResponse struct {
	Version       string         `json:"version"`
	Message       string         `json:"message"`
	Configuration *config.Config `json:"configuration"`
}

type ListParams added in v1.1.0

type ListParams struct {
	// sort param
	Sort string `form:"sort"`

	// Deprecated
	// page_no param (offset-based)
	PageNo int `form:"page_no"`
	// Deprecated
	// page_size param (offset-based)
	PageSize int `form:"page_size"`

	// cursor limit param
	Limit *int `form:"limit"`
	// cursor after param
	After *string `form:"after"`
	// cursor before param
	Before *string `form:"before"`
}

func (*ListParams) Query added in v1.1.0

func (p *ListParams) Query() *dao.Query

func (*ListParams) Validate added in v1.1.0

func (p *ListParams) Validate() error

type Options added in v0.8.0

type Options struct {
	Config      *config.Config
	DB          *db.DB
	Dispatcher  *dispatcher.Dispatcher
	Middlewares []mux.MiddlewareFunc
}

type Pagination

type Pagination[T any] struct {
	Total int64 `json:"total"`
	Data  []T   `json:"data"`
}

type Params added in v1.1.0

type Params interface {
	Validate() error
}

type PluginListParams added in v1.1.0

type PluginListParams struct {
	ListParams

	Name         *string           `form:"name"`
	Enabled      *bool             `form:"enabled"`
	CreatedAt    *int64            `form:"created_at"`
	CreatedAtGT  *int64            `form:"created_at[gt]"`
	CreatedAtGTE *int64            `form:"created_at[gte]"`
	CreatedAtLT  *int64            `form:"created_at[lt]"`
	CreatedAtLTE *int64            `form:"created_at[lte]"`
	Metadata     map[string]string `form:"metadata"`
	EndpointId   *string           `form:"endpoint_id"`
	SourceId     *string           `form:"source_id"`
}

func (*PluginListParams) Query added in v1.1.0

func (p *PluginListParams) Query() *dao.Query

type SourceListParams added in v1.1.0

type SourceListParams struct {
	ListParams

	Name         *string           `form:"name"`
	Enabled      *bool             `form:"enabled"`
	CreatedAt    *int64            `form:"created_at"`
	CreatedAtGT  *int64            `form:"created_at[gt]"`
	CreatedAtGTE *int64            `form:"created_at[gte]"`
	CreatedAtLT  *int64            `form:"created_at[lt]"`
	CreatedAtLTE *int64            `form:"created_at[lte]"`
	Metadata     map[string]string `form:"metadata"`
}

func (*SourceListParams) Query added in v1.1.0

func (p *SourceListParams) Query() *dao.Query

type WorkspaceListParams added in v1.1.0

type WorkspaceListParams struct {
	ListParams

	Name         *string           `form:"name"`
	CreatedAt    *int64            `form:"created_at"`
	CreatedAtGT  *int64            `form:"created_at[gt]"`
	CreatedAtGTE *int64            `form:"created_at[gte]"`
	CreatedAtLT  *int64            `form:"created_at[lt]"`
	CreatedAtLTE *int64            `form:"created_at[lte]"`
	Metadata     map[string]string `form:"metadata"`
}

func (*WorkspaceListParams) Query added in v1.1.0

func (p *WorkspaceListParams) Query() *dao.Query

Jump to

Keyboard shortcuts

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