service

package
v0.0.0-...-b08aade Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GitlabUrl           string        `conf:"required"`
	GitlabToken         string        `conf:"required,noprint"`
	CacheExpireDuration time.Duration `conf:"default:60m"`
	CacheFilePath       string        `conf:""`
	VendorWhitelist     []string      `conf:""`
	Port                int           `conf:"default:4000"`
	HttpTimeout         time.Duration `conf:"default:30s"`
	NoCache             bool          `conf:"default:false"`
	HttpCredentials     string        `conf:""`
}

func (*Config) GetHttpCredentials

func (config *Config) GetHttpCredentials() (string, string)

GetHttpCredentials returns username:password combination as username, password pair

func (*Config) IsVendorAllowed

func (config *Config) IsVendorAllowed(vendorName string) bool

IsVendorAllowed checks if the given vendor is allowed

func (*Config) Validate

func (config *Config) Validate() error

Validate the configuration

type Service

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

func New

func New(config Config, logger *log.Logger, errorChan chan error) *Service

func (*Service) Run

func (s *Service) Run() error

func (*Service) Stop

func (s *Service) Stop() error

Jump to

Keyboard shortcuts

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