api

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package api implements the API server for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorToStatus added in v0.7.0

func ErrorToStatus(err error) *status.Status

ErrorToStatus converts an application error to a gRPC status. Compatible with grpchelper.GRPCCodesConverterHandler.

func New

func New(grpcSrv *grpc.Server, healthSrv *health.Server, applications core.CoreService)

New registers the API handler on the given gRPC server and sets the health serving status. The gRPC server and health server are expected to be created externally (e.g. via grpchelper.NewServer).

Types

type API

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

API provides the API server implementation.

func (*API) GenerateCode

func (api *API) GenerateCode(ctx context.Context, request *generator.GenerateCodeRequest) (*generator.GenerateCodeResponse, error)

GenerateCode implements generator.PluginGeneratorServiceServer.

func (*API) Plugins

Plugins implements generator.ServiceAPIServer.

type AuditInterceptor added in v0.7.0

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

AuditInterceptor creates a gRPC UnaryServerInterceptor for audit logging.

func NewAuditInterceptor added in v0.7.0

func NewAuditInterceptor(entries chan<- core.AuditEntry, logger *slog.Logger) *AuditInterceptor

NewAuditInterceptor creates a new AuditInterceptor with the given audit channel and logger.

func (*AuditInterceptor) UnaryServerInterceptor added in v0.7.0

func (a *AuditInterceptor) UnaryServerInterceptor() grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a grpc.UnaryServerInterceptor that records audit entries.

Jump to

Keyboard shortcuts

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