service

package
v0.0.0-...-1e3d7a6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "latest"

Functions

func RunMigrations

func RunMigrations(svc *BDayService) error

RunMigrations runs db migrations

Types

type BDay

type BDay struct {
	DateOfBirth string `json:"dateOfBirth"`
}

type BDayService

type BDayService struct {
	DbHost        string `envconfig:"DB_HOST" required:"true"`
	DbUser        string `envconfig:"DB_USER" required:"true"`
	DbPass        string `envconfig:"DB_PASS" required:"true"`
	DbPort        string `envconfig:"DB_PORT" required:"true"`
	DbName        string `envconfig:"DB_NAME" required:"true"`
	HttpPort      string `envconfig:"HTTP_PORT" default:"8080"`
	MetricsPort   string `envconfig:"METRICS_PORT" default:"9090"`
	MigrationsDir string `envconfig:"MIGRATIONS_DIR" default:"/migrations"`
	ShutdownWait  int    `envconfig:"HTTP_SHUTDOWN_WAIT" default:"1"`
	Debug         bool   `envconfig:"DEBUG" default:"false"`
	// contains filtered or unexported fields
}

BDayService is the struct for service config

func NewBDayService

func NewBDayService() (*BDayService, error)

NewBDayService creates new instance of the services

func (*BDayService) ConnectDB

func (b *BDayService) ConnectDB() error

ConnectDB connects to db and store db connection in service object

func (*BDayService) Run

func (b *BDayService) Run()

Run runs the services

type Message

type Message struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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