api

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 18 Imported by: 3

Documentation

Overview

Package api contains the api used by scribe

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB added in v0.0.23

func InitDB(ctx context.Context, databaseType string, path string, metrics metrics.Handler, skipMigrations bool) (db.EventDB, error)

InitDB initializes a database given a database type and path. TODO: use enum for database type.

func Start

func Start(ctx context.Context, cfg Config, handler metrics.Handler) error

Start starts the api server.

Types

type Config

type Config struct {
	// Port is the http port for the api.
	Port uint16
	// Database is the database type.
	// TODO: should be enum
	Database string
	// Path is the path to the database or db connection.
	// TODO: should be renamed
	Path string
	// OmniRPCURL is the url of the omnirpc service.
	OmniRPCURL string
	// SkipMigrations skips the database migrations.
	SkipMigrations bool
}

Config contains the config for the api.

Jump to

Keyboard shortcuts

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