Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
frantjc committed Dec 4, 2024
1 parent d25d9fd commit d3ba373
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
3 changes: 0 additions & 3 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ import (
// Container represents a container created by a ContainerRuntime.
type Container interface {
GetID() string

CopyTo(context.Context, string, io.Reader) error
CopyFrom(context.Context, string) (io.ReadCloser, error)

Run(context.Context, *Streams) (int, error)
Start(context.Context) error
Restart(context.Context) error
Exec(context.Context, *ContainerConfig, *Streams) (int, error)

Stop(context.Context) error
Remove(context.Context) error
Kill(context.Context) error
Expand Down
2 changes: 1 addition & 1 deletion forgeactions/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// package forgeactions utilizes types and functionality specific to
// GitHub Actions to create types and functionality specific to Forge
// to enable the execution of a GitHub Action.
// to enable the execution of GitHub Actions.
package forgeactions
2 changes: 1 addition & 1 deletion forgeazure/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// package forgeazure utilizes types and functionality specific to
// Azure DevOps to create types and functionality specific to Forge
// to enable the execution of a Azure Devops Task.
// to enable the execution of Azure Devops Tasks.
package forgeazure
2 changes: 1 addition & 1 deletion forgecloudbuild/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// package forgecloudbuild utilizes types and functionality specific to
// Google CloudBuild to create types and functionality specific to Forge
// to enable the execution of a Google CloudBuild Step.
// to enable the execution of Google CloudBuild Steps.
package forgecloudbuild
2 changes: 1 addition & 1 deletion forgeconcourse/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// package forgeconcourse utilizes types specific to Concourse
// to create types and functionality specific to Forge to enable
// the execution of a Concourse Resource.
// the execution of Concourse Resources.
package forgeconcourse
3 changes: 3 additions & 0 deletions githubactions/uses.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ type Uses struct {
Version string
}

// IsLocal returns if the Uses refers to an Action on the local filesystem.
func (u *Uses) IsLocal() bool {
// A GitHub org cannot start with ".", so this correctly identifies if the path is "." or "./path/to/action".
return strings.HasPrefix(u.Path, ".") || filepath.IsAbs(u.Path) || len(strings.Split(u.Path, "/")) < 2
}

// IsRemote returns if the Uses refers to an Action in a GitHub repository.
func (u *Uses) IsRemote() bool {
return !u.IsLocal()
}
Expand Down
5 changes: 5 additions & 0 deletions runtime/docker/container_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ func New(c *client.Client, dind bool) *ContainerRuntime {
return &ContainerRuntime{c, dind}
}

// ContainerRuntime implements github.com/frantjc/forge.ContainerRuntime.
type ContainerRuntime struct {
// Client interacts with a Docker daemon.
*client.Client
// DockerInDocker signals whether or not to mount the docker.sock of the
// *github.com/docker/docker/client.Client and configuration to direct
// `docker` to it into each container that it runs.
DockerInDocker bool
}

Expand Down
2 changes: 1 addition & 1 deletion streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// DefaultDetachKeys are the default key combinations
// to use when detaching from a Container that has
// been attached to.
var DefaultDetachKeys = "ctrl-d"
const DefaultDetachKeys = "ctrl-d"

// Streams represents streams to and from a process
// inside of a Container.
Expand Down

0 comments on commit d3ba373

Please sign in to comment.