inertia: Index | Files

package common

import ""

Package common provides utilities, shared variables, and types for both the client and the daemon


Package Files

doc.go git.go util.go

func CheckForDockerCompose Uses

func CheckForDockerCompose(cwd string) bool

CheckForDockerCompose returns false if current directory is a not a docker-compose project

func CheckForDockerfile Uses

func CheckForDockerfile(cwd string) bool

CheckForDockerfile returns false if current directory is a not a Dockerfile project

func ExtractRepository Uses

func ExtractRepository(URL string) string

ExtractRepository gets the project name from its URL in the form [username]/[project]

func GenerateRandomString Uses

func GenerateRandomString() (string, error)

GenerateRandomString creates a rand.Reader-generated string for use with simple secrets and identifiers

func GetBranchFromRef Uses

func GetBranchFromRef(ref string) string

GetBranchFromRef gets the branch name from a git ref of form refs/...

func GetFullPath Uses

func GetFullPath(relPath string) (string, error)

GetFullPath returns the absolute path of the config file.

func GetSSHRemoteURL Uses

func GetSSHRemoteURL(url string) string

GetSSHRemoteURL gets the URL of the given remote in the form "[USER]/[REPOSITORY].git"

func ParseDate Uses

func ParseDate(dateString string) *time.Time

ParseDate parses a date in format "2006-01-02T15:04:05.000Z"

func ParseInt64 Uses

func ParseInt64(value string) (int64, error)

ParseInt64 parses a string into an int64 value

func RemoveContents Uses

func RemoveContents(directory string) error

RemoveContents removes all files within given directory, returns nil if successful

type DevNull Uses

type DevNull struct{}

DevNull writes to null, since a nil io.Writer will break shit

func (DevNull) Write Uses

func (dn DevNull) Write(p []byte) (n int, err error)

Package common imports 9 packages (graph) and is imported by 17 packages. Updated 2020-08-30. Refresh now. Tools for package owners.