Documentation ¶
Index ¶
- Constants
- func RunContainer(ctx context.Context, client DockerClient, t Trigger, opts RunContainerOptions) (*container.ContainerCreateCreatedBody, error)
- type BuildStatus
- type Controller
- type DockerClient
- type MessageType
- type NewControllerOptions
- type Poll
- type RunContainerOptions
- type Trigger
- type WebHook
Constants ¶
View Source
const ( Successful BuildStatus = "success" Failure = "failed" Skipped = "skipped" )
Variables ¶
This section is empty.
Functions ¶
func RunContainer ¶
func RunContainer(ctx context.Context, client DockerClient, t Trigger, opts RunContainerOptions) (*container.ContainerCreateCreatedBody, error)
Types ¶
type BuildStatus ¶
type BuildStatus string
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller that reconciles and manages containers
func NewController ¶
func NewController(opts NewControllerOptions) (*Controller, error)
NewController creates a new controller from arguments
func (*Controller) Close ¶
func (c *Controller) Close() error
func (*Controller) HandleTrigger ¶
func (c *Controller) HandleTrigger(ctx *gin.Context)
HandleTrigger handles trigger web requests
func (*Controller) HandleWebHook ¶
func (c *Controller) HandleWebHook(ctx *gin.Context)
func (*Controller) Listen ¶
func (c *Controller) Listen()
func (*Controller) StopPolling ¶
func (c *Controller) StopPolling()
type DockerClient ¶
type DockerClient interface { ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) ContainerStart(ctx context.Context, containerID string, opts types.ContainerStartOptions) error ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) }
Interface that defines the API surface of the Docker interactions
type MessageType ¶
type MessageType interface {
Validate() error
}
type NewControllerOptions ¶
type NewControllerOptions struct { Cfg *config.Config Client DockerClient }
NewControllerOptions specifies options for creating new controllers
type RunContainerOptions ¶
type RunContainerOptions struct {
Name string
}
Click to show internal directories.
Click to hide internal directories.