environ

package
v0.0.0-...-901012e Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package environ is a custom environment variable utilities for otto

Index

Constants

This section is empty.

Variables

View Source
var ReservedKeys = []string{
	"OTTO_SERVER_VERSION",
	"OTTO_SERVER_URL",
	"OTTO_HOST_ADDRESS",
	"OTTO_HOST_PORT",
	"OTTO_HOST_PSK",
}

ReservedKeys keys reserved by the otto system

Functions

func Map

func Map(vars []Variable) map[string]string

Map will return a mapping of key => value from the given slice of variables

func Validate

func Validate(vars []Variable) error

Validate will return if any of the variables are invalid

Types

type Variable

type Variable struct {
	Key    string
	Value  string
	Secret bool
}

Variable describes a single variable

func FromMap

func FromMap(m map[string]string) []Variable

FromMap return an array of variables form the given map

func Merge

func Merge(original []Variable, adding []Variable) []Variable

Merge will merge the given two variable slices. Objects from `original` will be replaces by any from `adding` if there are duplicate keys

func New

func New(key string, value string) Variable

New create a new variable

Jump to

Keyboard shortcuts

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