api

package
v0.19.930 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIGroupParam

func APIGroupParam(f any) any

func AsAPI

func AsAPI(f any) any

func AsService

func AsService(f any) any

Types

type API

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

func NewAdminDashboardAPI

func NewAdminDashboardAPI(params Params) (*API, error)

func NewAuthAPI

func NewAuthAPI(params Params) (*API, error)

func NewInternalAPI

func NewInternalAPI(params Params) (*API, error)

func NewPublicAPI

func NewPublicAPI(params Params) (*API, error)

func NewRunnerAPI

func NewRunnerAPI(params Params) (*API, error)

func NewSlackAPI added in v0.19.927

func NewSlackAPI(params Params) (*API, error)

NewSlackAPI builds the dedicated HTTP listener for Slack-originating traffic: OAuth callback, slash commands, and Slack Events API webhooks.

This is a separate listener (its own port, its own ingress) rather than being mounted on the public API to keep Slack's signing-secret-based auth model isolated from the API-key + org-id model used by /v1/*.

type APIContextType

type APIContextType string
const (
	APIContextTypePublic   APIContextType = "public"
	APIContextTypeRunner   APIContextType = "runner"
	APIContextTypeInternal APIContextType = "internal"
)

func (APIContextType) String

func (a APIContextType) String() string

type EndpointAudit

type EndpointAudit struct {
	// map to hold deprecated endpoints
	// format: method_name_path (e.g., GET_public_/v1/old-endpoint)
	Routes map[string]struct{}
}

func NewEndpointAudit

func NewEndpointAudit() *EndpointAudit

func (*EndpointAudit) Add

func (d *EndpointAudit) Add(method, name, path string)

func (*EndpointAudit) IsDeprecated

func (d *EndpointAudit) IsDeprecated(method, name, path string) bool

type Params

type Params struct {
	fx.In

	LC         fx.Lifecycle
	Shutdowner fx.Shutdowner

	Services      []Service                `group:"services"`
	Middlewares   []middlewares.Middleware `group:"middlewares"`
	L             *zap.Logger
	Cfg           *internal.Config
	DB            *gorm.DB `name:"psql"`
	EndpointAudit *EndpointAudit
}

type RouteRegister

type RouteRegister struct {
	EndpointAudit *EndpointAudit
}

func (*RouteRegister) DELETE

func (r *RouteRegister) DELETE(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

func (*RouteRegister) GET

func (r *RouteRegister) GET(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

func (*RouteRegister) PATCH

func (r *RouteRegister) PATCH(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

func (*RouteRegister) POST

func (r *RouteRegister) POST(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

func (*RouteRegister) PUT

func (r *RouteRegister) PUT(router gin.IRouter, relativePath string, handler gin.HandlerFunc, context APIContextType, deprecated bool)

type Service

type Service interface {
	RegisterPublicRoutes(*gin.Engine) error
	RegisterRunnerRoutes(*gin.Engine) error
	RegisterInternalRoutes(*gin.Engine) error
	RegisterAuthRoutes(*gin.Engine) error
	RegisterAdminDashboardRoutes(*gin.Engine) error
	RegisterSlackRoutes(*gin.Engine) error
}

Jump to

Keyboard shortcuts

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