api

package
v0.0.0-...-a562f3a Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEnv = errors.New("not a valid Env")

Functions

func GetAppEnv

func GetAppEnv() string

GetAppEnv returns the current app environment.

func IsDevelopment

func IsDevelopment() bool

IsDevelopment will return true if the APP_ENV is equals to dev.

func IsLocal

func IsLocal() bool

IsLocal will return true if the APP_ENV is equals to local.

func IsProduction

func IsProduction() bool

IsProduction will return true if the APP_ENV is equals to prod.

Types

type Env

type Env string

Env represents the environment of the application. ENUM( local development production )

const (
	// EnvLocal is a Env of type local.
	EnvLocal Env = "local"
	// EnvDevelopment is a Env of type development.
	EnvDevelopment Env = "development"
	// EnvProduction is a Env of type production.
	EnvProduction Env = "production"
)

func ParseEnv

func ParseEnv(name string) (Env, error)

ParseEnv attempts to convert a string to a Env.

func (Env) IsValid

func (x Env) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Env) String

func (x Env) String() string

String implements the Stringer interface.

type Server

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

Server is an api server

func NewServer

func NewServer() *Server

NewServer creates a new server

func (*Server) Start

func (s *Server) Start(ctx context.Context) <-chan struct{}

Start starts the server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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