Categorygithub.com/aalpern/svc
modulepackage
0.1.0
Repository: https://github.com/aalpern/svc.git
Documentation: pkg.go.dev

# README

SVC

Stochastic Vehicular Constabulary

Snarky Vampires Cavorting

Soggy View Controller

Superb Vanishing Carrots*

Or, perhaps, a service framework of some kind.

(But seriously....)

At Anki we built a lot of REST and GRPC services in Go, and had built up a clean and fully featured framework for building cloud service projects. It covered handling the basics of making a well behaved process with a defined startup and graceful shutdown lifecycle, composition of shared components, standard handlers and interceptors, integrated with command line handling and standardized logging and metrics and multiple authentication systems.

It was my hope that we'd be able to remove the product-specific bits that inevitably crept in and open-source it one day, but that hope died when Anki abruptly shut down.

Now that I'm working on some personal projects again in Go, I find myself needing that again, so this is my attempt to recreate part of it from scratch, but better this time.

* Apologies to npm

# Packages

No description provided by the author

# Functions

GetService extracts and returns the service pointer bound as a context value, or nil if no service pointer was found in the supplied context.
No description provided by the author
No description provided by the author
NewService constructs a new Service instance from the given name, descript, and configs.
No description provided by the author
No description provided by the author
No description provided by the author
WithComponentCommand creates a new command for the service process and binds it to the supplied Component, whose Start() method becomes the main loop of the command.
No description provided by the author
No description provided by the author
No description provided by the author
WithServiceContext returns a derived context with the supplied pointer to a Service instance bound as a value.

# Structs

---------------------------------------------------------------------- CompositeComponent is an implementation of Component for composing multiple components together.
No description provided by the author
---------------------------------------------------------------------- NamedComponentList manages a list of zero or more ordered components tagged with optional names.
Service defines the root command and entry point for a persistent service process.
---------------------------------------------------------------------- SimpleComponent is a concrete implementation of both Component and CommandInitializer allowing for simple components to be constructed inline out of handler functions.

# Interfaces

No description provided by the author
---------------------------------------------------------------------- Component defines the basic lifecycle interface for types that can be started up and shut down.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author