util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetenvOrDefault

func GetenvOrDefault(envVar, defaultVal string) string

GetenvOrDefault will return the value of the given enrvironment variable, or, if it's blank, will return the defaultVal.

func IsGitHubFileNotFoundErr

func IsGitHubFileNotFoundErr(errString string) bool

func ReadJSON

func ReadJSON(reader io.Reader, dest interface{}) error

ReadJSON takes a json byte stream from a reader and decodes it into the struct passed in.

func WriteHTTPError

func WriteHTTPError(w http.ResponseWriter, code int, err error)

WriteHTTPError writes an HTTP error to an http.ResponseWriter

func WriteJSON

func WriteJSON(obj interface{}, w http.ResponseWriter)

WriteJSON encodes an object to a json string and writes it to the writer.

Types

type GitHubFileNotFoundErr

type GitHubFileNotFoundErr struct {
	Org  string
	Repo string
	Path string
}

func (*GitHubFileNotFoundErr) Error

func (e *GitHubFileNotFoundErr) Error() string

type GithubRateLimitErr

type GithubRateLimitErr struct {
	RateLimit int
	RateReset string
}

func (*GithubRateLimitErr) Error

func (e *GithubRateLimitErr) Error() string

type PlankClient

type PlankClient interface {
	GetApplication(string) (*plank.Application, error)
	CreateApplication(*plank.Application) error
	GetPipelines(string) ([]plank.Pipeline, error)
	DeletePipeline(plank.Pipeline) error
	UpsertPipeline(plank.Pipeline, string) error
	ResyncFiat() error
	ArmoryEndpointsEnabled() bool
	EnableArmoryEndpoints()
}

Jump to

Keyboard shortcuts

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