config

package
v0.0.0-...-3cc3ff2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 26 Imported by: 0

README

Config

CLI configurations could be stored inside a HCL configuration file. A configuration file could be referenced when executing a CLI command. Environment variables could be used inside the HCL definitions.

log_level = "$LOG_LEVEL"
protobuffers = ["../../annotations", "./proto/*.proto"]

include = ["flow.hcl"]

graphql {
    address = "$GRAPHQL_ADDRESS"
}

grpc {
    address = "$GRPC_ADDRESS"
}

http {
    address = "$HTTP_ADDRESS"
}

prometheus {
    address = ":5050"
}

services {
    select "proto.users.*" {
        host = "api.jexia.com"
    }

    select "proto.projects.*" {
        host = "api.jexia.com"
    }
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFunctions = functions.Custom{
	"sprintf":   sprintf.Function,
	"strconcat": strconcat.Function,
}

DefaultFunctions represents the default functions collection

Functions

func NewCore

func NewCore(ctx *broker.Context, flags *Daemon) (semaphore.Options, error)

NewCore constructs new core options from the given parameters.

func NewProviders

func NewProviders(ctx *broker.Context, core semaphore.Options, params *Daemon) (providers.Options, error)

NewProviders constructs new providers options from the given parameters.

func SetOptions

func SetOptions(ctx *broker.Context, flags *Daemon) error

SetOptions reads the available configuration files and attempts to set the read options.

Types

type Daemon

type Daemon struct {
	LogLevel     string
	HTTP         HTTP
	GraphQL      GraphQL
	GRPC         GRPC
	Prometheus   Prometheus
	Protobuffers []string
	Avro         []string
	Openapi3     []string
	Files        []string
}

Daemon configurations.

type GRPC

type GRPC struct {
	Address string
}

GRPC configurations.

type GraphQL

type GraphQL struct {
	Address string
}

GraphQL configurations.

type HTTP

type HTTP struct {
	Address      string
	Origin       []string
	CertFile     string
	KeyFile      string
	ReadTimeout  string
	WriteTimeout string
}

HTTP configurations.

type Prometheus

type Prometheus struct {
	Address string
}

Prometheus configurations.

Jump to

Keyboard shortcuts

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