env

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

Obvious env helper methods

Contributor Covenant License GitHub release

Simple environment variable helper library

How to Use

Installation
go get github.com/go-obvious/env
Example Usage
package main

import (
    "fmt"
    "github.com/go-obvious/env"
)

func main() {
    // Load environment variables from a .env file
    value := env.GetOr("MY_VARIABLE", "nothing")
    fmt.Println("Got:", value)
}

Documentation

Overview

SPDX-FileCopyrightText: Copyright (c) 2024, Obviously, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(name string) bool

func Get

func Get(name string) string

func GetArray

func GetArray(name, sep string, allowQuotes, trimQuoted bool) []string

func GetBoolOr

func GetBoolOr(name string, dval bool) bool

func GetOr

func GetOr(name, dval string) string

func GetUintOr

func GetUintOr(name string, dval uint) uint

func MustGet

func MustGet(name string) string

func MustGetArray

func MustGetArray(name, sep string, allowQuotes, trimQuoted bool) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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