config

package
v0.0.0-...-e9f7c1f Latest Latest
Warning

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

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

Documentation

Overview

Package config implements structures to store Nixery's configuration at runtime as well as the logic for instantiating this configuration from the environment.

Copyright 2022 The TVL Contributors SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	GCS = iota
	FileSystem
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend int

Backend represents the possible storage backend types

type Config

type Config struct {
	Port    string    // Port on which to launch HTTP server
	Pkgs    PkgSource // Source for Nix package set
	Timeout string    // Timeout for a single Nix builder (seconds)
	WebDir  string    // Directory with static web assets
	PopUrl  string    // URL to the Nix package popularity count
	Backend Backend   // Storage backend to use for Nixery
}

Config holds the Nixery configuration options.

func FromEnv

func FromEnv() (Config, error)

type GitSource

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

func (*GitSource) CacheKey

func (g *GitSource) CacheKey(pkgs []string, tag string) string

func (*GitSource) Render

func (g *GitSource) Render(tag string) (string, string)

type NixChannel

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

func (*NixChannel) CacheKey

func (n *NixChannel) CacheKey(pkgs []string, tag string) string

func (*NixChannel) Render

func (n *NixChannel) Render(tag string) (string, string)

type PkgSource

type PkgSource interface {
	// Convert the package source into the representation required
	// for calling Nix.
	Render(tag string) (string, string)

	// Create a key by which builds for this source and image
	// combination can be cached.
	//
	// The empty string means that this value is not cacheable due
	// to the package source being a moving target (such as a
	// channel).
	CacheKey(pkgs []string, tag string) string
}

PkgSource represents the source from which the Nix package set used by Nixery is imported. Users configure the source by setting one of the supported environment variables.

type PkgsPath

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

func (*PkgsPath) CacheKey

func (p *PkgsPath) CacheKey(pkgs []string, tag string) string

func (*PkgsPath) Render

func (p *PkgsPath) Render(tag string) (string, string)

Jump to

Keyboard shortcuts

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