Documentation ¶
Overview ¶
Package common provides utilities, shared variables, and types for both the client and the daemon
Index ¶
- Constants
- func CheckForDockerCompose(cwd string) bool
- func CheckForDockerfile(cwd string) bool
- func CheckForProcfile(cwd string) bool
- func ExtractRepository(URL string) string
- func GenerateRandomString() (string, error)
- func GetBranchFromRef(ref string) string
- func GetFullPath(relPath string) (string, error)
- func GetSSHRemoteURL(url string) string
- func ParseDate(dateString string) *time.Time
- func ParseInt64(value string) (int64, error)
- func RemoveContents(directory string) error
- type DeploymentStatus
- type DevNull
- type EnvRequest
- type GitOptions
- type UpRequest
- type UserRequest
Constants ¶
const ( // MsgDaemonOK is the OK response upon successfully reaching daemon MsgDaemonOK = "I'm a little Webhook, short and stout!" // Container is a constant used in HTTP GET query strings Container = "container" // Stream is a constant used in HTTP GET query strings Stream = "stream" // Entries is a constant used in HTTP GET query strings Entries = "entries" )
Variables ¶
This section is empty.
Functions ¶
func CheckForDockerCompose ¶
CheckForDockerCompose returns false if current directory is a not a docker-compose project
func CheckForDockerfile ¶ added in v0.3.0
CheckForDockerfile returns false if current directory is a not a Dockerfile project
func CheckForProcfile ¶ added in v0.4.0
CheckForProcfile returns false if current directory is not a Heroku project
func ExtractRepository ¶ added in v0.4.0
ExtractRepository gets the project name from its URL in the form [username]/[project]
func GenerateRandomString ¶ added in v0.4.0
GenerateRandomString creates a rand.Reader-generated string for use with simple secrets and identifiers
func GetBranchFromRef ¶ added in v0.1.1
GetBranchFromRef gets the branch name from a git ref of form refs/...
func GetFullPath ¶ added in v0.4.0
GetFullPath returns the absolute path of the config file.
func GetSSHRemoteURL ¶
GetSSHRemoteURL gets the URL of the given remote in the form "git@github.com:[USER]/[REPOSITORY].git"
func ParseInt64 ¶ added in v0.4.0
ParseInt64 parses a string into an int64 value
func RemoveContents ¶
RemoveContents removes all files within given directory, returns nil if successful
Types ¶
type DeploymentStatus ¶ added in v0.3.0
type DeploymentStatus struct { InertiaVersion string `json:"version"` Branch string `json:"branch"` CommitHash string `json:"commit_hash"` CommitMessage string `json:"commit_message"` BuildType string `json:"build_type"` Containers []string `json:"containers"` BuildContainerActive bool `json:"build_active"` }
DeploymentStatus lists details about the deployed project
type DevNull ¶ added in v0.4.1
type DevNull struct{}
DevNull writes to null, since a nil io.Writer will break shit
type EnvRequest ¶ added in v0.4.0
type EnvRequest struct { Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` Encrypt bool `json:"encrypt,omitempty"` Remove bool `json:"remove,omitempty"` }
EnvRequest represents a request to manage environment variables
type GitOptions ¶
GitOptions represents GitHub-related deployment options
type UpRequest ¶ added in v0.4.0
type UpRequest struct { Stream bool `json:"stream"` Project string `json:"project"` BuildType string `json:"build_type"` BuildFilePath string `json:"build_file_path"` GitOptions *GitOptions `json:"git_options"` WebHookSecret string `json:"webhook_secret"` }
UpRequest is the configurable body of a UP request to the daemon.