go-james: github.com/pieterclaerhout/go-james/internal/config Index | Files

package config

import "github.com/pieterclaerhout/go-james/internal/config"

Index

Package Files

config.go

Constants

const FileName = "go-james.json"

FileName is the name of the config file

type BuildConfig Uses

type BuildConfig struct {
    OutputPath     string   `json:"output_path"`      // The path of the executable to generate
    LDFlags        []string `json:"ld_flags"`         // The ldflags to pass to the build command
    LDFlagsDarwin  []string `json:"ld_flags_darwin"`  // The ldflags to pass to the build command for Darwin
    LDFlagsLinux   []string `json:"ld_flags_linux"`   // The ldflags to pass to the build command for Linux
    LDFlagsWindows []string `json:"ld_flags_windows"` // The ldflags to pass to the build command for Windows
    ExtraArgs      []string `json:"extra_args"`       // The extra arguments to pass to the build command
}

BuildConfig contains the build specific configuration settings

type Config Uses

type Config struct {
    Project ProjectConfig `json:"project"` // Project contains the general project variables
    Build   BuildConfig   `json:"build"`   // Build contains the build specific project variables
    Package PackageConfig `json:"package"` // Build contains the package specific project variables
    Run     RunConfig     `json:"run"`     // Build contains the run specific project variables
    Test    TestConfig    `json:"test"`    // Build contains the test specific project variables
}

Config defines the project configuration

func NewConfigFromDir Uses

func NewConfigFromDir(path string) (Config, error)

NewConfigFromDir parses the config from a file called "go-james.json" which should be present in the specified path

func NewConfigFromPath Uses

func NewConfigFromPath(path string) (Config, error)

NewConfigFromPath reads the configuration file from the specified path and returns the configuration settings

type PackageConfig Uses

type PackageConfig struct {
    IncludeReadme bool `json:"include_readme"` // Include the readme when packaging or not
}

PackageConfig contains the build specific configuration settings

type ProjectConfig Uses

type ProjectConfig struct {
    Name        string `json:"name"`         // The name of the project
    Version     string `json:"version"`      // The version of the project
    Description string `json:"description"`  // The description of the project
    Copyright   string `json:"copyright"`    // The copyright statement for the project
    MainPackage string `json:"main_package"` // The package path to the main entry point (the package containing main)
}

ProjectConfig contains the general project variables

type RunConfig Uses

type RunConfig struct {
    Environ map[string]string `json:"environ"` // The environment variables to use when running
}

RunConfig contains the run specific configuration settings

type TestConfig Uses

type TestConfig struct {
    ExtraArgs []string `json:"extra_args"` // The extra arguments to pass to the test command
}

TestConfig contains the test specific configuration settings

Package config imports 6 packages (graph) and is imported by 12 packages. Updated 2019-12-14. Refresh now. Tools for package owners.