api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package api provides HTTP handlers for the CodeAI API.

Package api provides the HTTP API for CodeAI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(h *handlers.Handler) chi.Router

NewRouter creates a new Chi router with all routes and middleware configured.

func NewRouterWithConfig

func NewRouterWithConfig(h *handlers.Handler, cfg RouterConfig) chi.Router

NewRouterWithConfig creates a new Chi router with optional handlers.

Types

type RouterConfig

type RouterConfig struct {
	EventHandler   *handlers.EventHandler
	WebhookHandler *webhooks.Handler
}

RouterConfig holds optional handlers for the router.

type Server

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

Server wraps an HTTP server with graceful shutdown support.

func NewServer

func NewServer(router chi.Router, addr string) *Server

NewServer creates a new Server with the given router and address.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the server's address.

func (*Server) Router

func (s *Server) Router() chi.Router

Router returns the server's router.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server with the given context. It waits for all active connections to finish or until the context is canceled.

func (*Server) Start

func (s *Server) Start() error

Start begins listening and serving HTTP requests. It blocks until the server is shut down.

Directories

Path Synopsis
Package handlers contains HTTP request handlers for the API.
Package handlers contains HTTP request handlers for the API.
compensation
Package compensation provides HTTP handlers for compensation operations.
Package compensation provides HTTP handlers for compensation operations.
jobs
Package jobs provides HTTP handlers for job-related API endpoints.
Package jobs provides HTTP handlers for job-related API endpoints.
notifications
Package notifications provides HTTP handlers for notification endpoints.
Package notifications provides HTTP handlers for notification endpoints.
webhooks
Package webhooks provides HTTP handlers for webhook management endpoints.
Package webhooks provides HTTP handlers for webhook management endpoints.
workflow
Package workflow provides HTTP handlers for workflow operations.
Package workflow provides HTTP handlers for workflow operations.
Package middleware provides HTTP middleware for the API.
Package middleware provides HTTP middleware for the API.
Package testing provides test utilities for the API package.
Package testing provides test utilities for the API package.
Package types defines API request and response types.
Package types defines API request and response types.

Jump to

Keyboard shortcuts

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