server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(app Application) error

Run runs the given application.

Types

type Application

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

Application abstracts all the functional components to be run by the server.

func Setup

func Setup(cfg Config) (Application, error)

Setup creates a new application using the given Config.

func (Application) Serve

func (app Application) Serve() error

Serve serves the application services.

type Config

type Config struct {
	config.Config
	DB config.Database `envPrefix:"DATABASE_"`
}

Config holds the configuration for this service. It currently uses env vars, but it can eventually migrate to a different config provider.

func ReadConfig

func ReadConfig() (Config, error)

ReadConfig reads the Config from environment variables.

func (Config) Listener

func (c Config) Listener() (network string, address string)

Listener returns the configuration needed to initialize a net.Listener instance.

type Services

type Services struct {
	Tasks tasksv1.TasksServiceServer
}

Services groups all the services exposed by a single gRPC Server.

Jump to

Keyboard shortcuts

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