server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingInterceptor

func LoggingInterceptor(
	ctx context.Context,
	req any,
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler,
) (any, error)

LoggingInterceptor logs the method name, duration, and error (if any) for every unary RPC call.

func NewGRPCServer

func NewGRPCServer(beadsServer *BeadsServer) *grpc.Server

NewGRPCServer creates a gRPC server with standard interceptors, registers the BeadsService, reflection, and returns the server ready to serve.

func RecoveryInterceptor

func RecoveryInterceptor(
	ctx context.Context,
	req any,
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler,
) (resp any, err error)

RecoveryInterceptor catches panics in downstream handlers, logs the stack trace, and returns a codes.Internal error instead of crashing the server.

Types

type BeadsServer

type BeadsServer struct {
	beadsv1.UnimplementedBeadsServiceServer
	// contains filtered or unexported fields
}

BeadsServer implements the beadsv1.BeadsServiceServer interface.

func NewBeadsServer

func NewBeadsServer(s store.Store, p events.Publisher) *BeadsServer

NewBeadsServer returns a new BeadsServer backed by the given store and publisher.

func (*BeadsServer) AddComment

AddComment adds a comment to a bead.

func (*BeadsServer) AddDependency

AddDependency creates a dependency between two beads.

func (*BeadsServer) AddLabel

AddLabel adds a label to a bead.

func (*BeadsServer) CloseBead

CloseBead marks a bead as closed.

func (*BeadsServer) CreateBead

CreateBead validates the request, persists a new bead, publishes a BeadCreated event, and returns the full bead.

func (*BeadsServer) DeleteBead

DeleteBead removes a bead by ID.

func (*BeadsServer) DeleteConfig

DeleteConfig removes a config by key.

func (*BeadsServer) GetBead

GetBead retrieves a single bead by ID.

func (*BeadsServer) GetComments

GetComments returns all comments for a bead.

func (*BeadsServer) GetConfig

GetConfig retrieves a config by key.

func (*BeadsServer) GetDependencies

GetDependencies returns all dependencies for a bead.

func (*BeadsServer) GetEvents

GetEvents returns all persisted events for a bead.

func (*BeadsServer) GetLabels

GetLabels returns all labels for a bead.

func (*BeadsServer) Health

Health returns the service health status.

func (*BeadsServer) ListBeads

ListBeads returns a filtered, paginated list of beads.

func (*BeadsServer) ListConfigs

ListConfigs returns configs matching a namespace prefix, merging in any builtin defaults that haven't been overridden by user-defined configs.

func (*BeadsServer) NewHTTPHandler

func (s *BeadsServer) NewHTTPHandler() http.Handler

NewHTTPHandler returns an http.Handler with all routes registered.

func (*BeadsServer) RemoveDependency

RemoveDependency removes a dependency between two beads.

func (*BeadsServer) RemoveLabel

RemoveLabel removes a label from a bead.

func (*BeadsServer) SetConfig

SetConfig creates or updates a config entry.

func (*BeadsServer) UpdateBead

UpdateBead applies partial updates to an existing bead.

Jump to

Keyboard shortcuts

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