arkd

package
v0.0.0-...-49d2269 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 5 Imported by: 0

README

arkd

Dependencies

  • hivemind

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetCapacity(ctx context.Context) error
	ListTasks(ctx context.Context, deploymentName string) ([]Task, error)
	GetTask(ctx context.Context, taskId string) error
	CreateTask(context.Context, CreateTaskParams) error
	UpdateTask(ctx context.Context, taskId string, updateParams string) error
	DeleteTask(ctx context.Context, taskId string) error

	DeleteDeployment(ctx context.Context, deploymentName string) error
}

func NewClient

func NewClient() Client

type CreateTaskParams

type CreateTaskParams struct {
	AppName        string   `json:"app_name"`
	DeploymentName string   `json:"deployment_name"`
	StackName      string   `json:"stack_name"`
	Image          string   `json:"image"`
	ExposedPorts   []string `json:"exposed_ports"`
}

type ImageRef

type ImageRef struct {
	FullName   string `json:"full_name"`
	Registry   string `json:"registry"`
	Repository string `json:"repository"`
	Tag        string `json:"tag"`
	Digest     string `json:"digest"`
}

func NewImageRef

func NewImageRef(image string) (ImageRef, error)

type Task

type Task struct {
	ID               ulid.ULID         `json:"id"`
	AppName          string            `json:"app_name"`
	DeploymentName   string            `json:"deployment_name"`
	StackName        string            `json:"stack_name"`
	ContainerID      string            `json:"container_id"`
	CPU              float64           `json:"cpu"`
	StartedAt        time.Time         `json:"started_at"`
	Status           TaskStatus        `json:"status"`
	Memory           int               `json:"memory"`
	Image            ImageRef          `json:"image"`
	HostPortBindings map[string]string `json:"host_port_bindings"`
}

func NewTask

func NewTask(taskDef TaskDefinition) (*Task, error)

func (*Task) Domain

func (t *Task) Domain() string

func (*Task) QualifiedName

func (t *Task) QualifiedName() string

type TaskDefinition

type TaskDefinition struct {
	AppName        string   `json:"app_name"`
	DeploymentName string   `json:"deployment_name"`
	StackName      string   `json:"stack_name"`
	Image          string   `json:"image"`
	HealthCheck    string   `json:"health_check"`
	Cpu            float64  `json:"cpu"`
	Memory         int      `json:"memory"`
	ExposedPorts   []string `json:"exposed_ports"`
}

type TaskStatus

type TaskStatus int
const (
	TaskStatusUnknown TaskStatus = iota
	TaskStatusPending
	TaskStatusImagePull
	TaskStatusCreating
	TaskStatusStarting
	TaskStatusRunning
	TaskStatusSuspended
	TaskStatusExited
	TaskStatusCrashed
)

Directories

Path Synopsis
cmd
internal
api

Jump to

Keyboard shortcuts

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