config

package
v0.0.0-...-4d77d7a Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HCLParseError = errors.New("failed to parse config")

HCLParseError occurs when an error is encountered while parsing HCL. It should not be logged to the console, as the error message will be printed by the HCL parser.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server Server `hcl:"server,block"`

	GoModules []*GoModule `hcl:"go_module,block"`
}

Config is the top-level configuration structure.

func Parse

func Parse(cfgPath string) (*Config, error)

Parse parses the config at a given path. If the path is a directory, all HCL in the directory will be parsed.

type GoModule

type GoModule struct {
	ID          string  `hcl:"id,label"`
	DisplayName *string `hcl:"display_name"`
	Description string  `hcl:"description,optional"`
	Path        string  `hcl:"path"`
	Upstream    string  `hcl:"upstream"`
	VCSType     *string `hcl:"vcs_type"`

	Readme string `hcl:"readme,optional"`
	Links  []Link `hcl:"link,block"`
}

GoModule defines a Go module that should be proxied.

func (*GoModule) ImportPath

func (m *GoModule) ImportPath(s Server) string
type Link struct {
	Text string `hcl:"text"`
	URL  string `hcl:"url"`
}

Link defines a link to be displayed on a package's page.

type Server

type Server struct {
	Host     string  `hcl:"host"`
	BindAddr *string `hcl:"bind_addr"`
}

Server contains the configuration for the Dieppe server itself.

Jump to

Keyboard shortcuts

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