bin

package
v0.0.0-...-fd78167 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Internal library used for the binary webservices

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// PostgresUri prefixes for lookups to the reference microservices
	Services struct {
		DarwinD3  string `yaml:"darwind3"`
		Reference string `yaml:"reference"`
		Timetable string `yaml:"timetable"`
		Ldb       string `yaml:"ldb"`
	} `yaml:"services"`

	Database struct {
		Path string `yaml:"path"`
		// Darwin Reference
		Reference string `yaml:"reference"`
		// Darwin Timetable
		Timetable string `yaml:"timetable"`
		// Darwin PushPort
		PushPort string `yaml:"pushPort"`
		// Live Departure Boards
		LDB string `yaml:"ldb"`
		// Knowledge Base - this is a directory name not an individual file
		KB string `yaml:"knowledgebase"`
	} `yaml:"database"`

	// S3 bucket used by the V16 feed
	S3 s3.S3Credentials `yaml:"s3"`

	// Used for archiving data
	Upload s3.S3Credentials `yaml:"upload"`

	KB struct {
		Username string `yaml:"username"`
		Password string `yaml:"password"`
		// Darwin V16 Incidents feed
		Incidents QueueDef `yaml:"incidents"`
	}

	RabbitMQ rabbitmq.RabbitMQ `yaml:"rabbitmq"`

	D3 struct {
		// Set to true to use the darwintt service to try to resulve unknown schedules
		ResolveSched bool `yaml:"resolveSchedules"`
		// Darwin V16 PusPort
		PushPort QueueDef `yaml:"pushPort"`
		// Darwin V16 Status feed
		Status QueueDef `yaml:"status"`
		// Prefix to the routingKeys used by the Event subsystem
		EventKeyPrefix string `yaml:"eventKeyPrefix"`
		// FTP used for snapshots
		Ftp struct {
			Enabled  bool   `yaml:"enabled"`
			Server   string `yaml:"server"`
			User     string `yaml:"user"`
			Password string `yaml:"password"`
		} `yaml:"ftp"`
	} `yaml:"d3"`

	DB struct {
		// PostgreSQL connection url
		PostgresUri string `yaml:"url"`
	} `yaml:"db"`

	Server struct {
		// Root context path, defaults to ""
		Context string `yaml:"context"`
		// The port to run on, defaults to 80
		Port int `yaml:"port"`
		// The permitted headers
		Headers []string
		// The permitted Origins
		Origins []string
		// The permitted methods
		Methods []string
	} `yaml:"server"`

	Graphite struct {
		Enabled  bool   `yaml:"enabled"`
		Prefix   string `yaml:"prefix"`
		Exchange string `yaml:"exchange"`
		Schedule string `yaml:"schedule"`
	} `yaml:"graphite"`
	// contains filtered or unexported fields
}

Common configuration used to read config.yaml

func (*Config) DbPath

func (c *Config) DbPath(s *string, d string) *Config

DbPath ensures the database name is set. If the name is not absolute then it's taken as being relative to the database path in config. s The required filename d The filename to use if s is ""

func (*Config) Init

func (a *Config) Init(k *kernel.Kernel) error

func (*Config) Name

func (a *Config) Name() string

func (*Config) PostInit

func (a *Config) PostInit() error

type Graphite

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

func (*Graphite) Init

func (a *Graphite) Init(k *kernel.Kernel) error

func (*Graphite) Name

func (g *Graphite) Name() string

func (*Graphite) PublishStatistic

func (g *Graphite) PublishStatistic(name string, s *statistics.Statistic)

PublishStatistic Handles publishing statistics to Graphite over RabbitMQ

func (*Graphite) Start

func (g *Graphite) Start() error

type QueueDef

type QueueDef struct {
	// The queue name to create
	QueueName string `yaml:"queueName"`
	// The routingKey to listen for inbound d3 messages
	RoutingKey string `yaml:"routingKey"`
}

Jump to

Keyboard shortcuts

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