config

package
v0.0.0-...-9c94f8f Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package config deals with the configuration file format used by terraform-simple-registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener interface {
	ListenAndServe(handler http.Handler) error
}

type Listeners

type Listeners map[Listener]struct{}

func (Listeners) ListenAndServe

func (ls Listeners) ListenAndServe(handler http.Handler)

ListenAndServe attempts to listen on all of the listeners in the receiver and then serves requests with the given handler on those that are successful.

Each listener operates in its own goroutine, which may in turn spawn additional goroutines as requests arrive.

This function never returns. If any of the listeners fail to listen, errors will be logged using the "log" package.

type Module

type Module struct {
	GitDir    string
	DeclRange hcl.Range
}

ModuleConfig is the configuration for a single module to be served from a module registry service.

type Modules

type Modules map[string]map[string]map[string]*Module

ModulesConfig is a map of many modules to serve from a module registry service. The keys of each respective map are the "namespace" (an arbitrary container that may be used to model internal departments, etc), the module name, and the provider.

type ModulesConfig

type ModulesConfig struct {
	Hostname  svchost.Hostname
	Listeners Listeners
	Modules   Modules
}

ModulesConfig is the root type of a configuration for a modules server.

func LoadModulesConfig

func LoadModulesConfig(body hcl.Body) (*ModulesConfig, hcl.Diagnostics)

LoadModulesConfig processes a raw HCL Body into a configuration for a module registry server.

If the returned diagnostics has errors, the returned configuration may be incomplete or invalid. Otherwise, the returned configuration is complete and guaranteed to be statically valid. (References to files, TCP ports, etc are not checked until they are used.)

Jump to

Keyboard shortcuts

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