Documentation
¶
Index ¶
- Constants
- func CleanupBackupObjects(ctx context.Context, storage BackupStorageConfig, ...) error
- func DeleteVolumeBackup(ctx context.Context, req BackupRequest) error
- func ExportImage(ctx context.Context, image string, w io.Writer) error
- func ReadMeshStatus(ctx context.Context, interfaceName string) (*mesh.Status, error)
- func RefreshActualStateDocuments(ctx context.Context, dataDir string, node string) (int, error)
- func ReleaseProjectPortAllocations(ctx context.Context, dataDir string, project string, environment string) error
- func ReleaseServicePortAllocations(ctx context.Context, dataDir string, project string, environment string, ...) error
- func ReleaseServicePortAllocationsExceptRevision(ctx context.Context, dataDir string, project string, environment string, ...) error
- func RestoreVolumeBackup(ctx context.Context, req BackupRequest) error
- func StreamProxyAccessLogs(ctx context.Context, tail int, follow bool, writer io.Writer) error
- func StreamServiceLogs(ctx context.Context, req LogsRequest, writer io.Writer) error
- func ValidateBackupStorage(storage BackupStorageConfig) error
- type ActualRefreshTarget
- type ActualService
- type ActualStateResponse
- type BackupCleanupResponse
- type BackupInfo
- type BackupListResponse
- type BackupObject
- type BackupObjectRetention
- type BackupRemoteInfo
- type BackupRequest
- type BackupScheduleRequest
- type BackupScheduleResponse
- type BackupScheduleVolume
- type BackupScheduler
- func (s *BackupScheduler) Delete(ctx context.Context, project string, environment string, service string) (*BackupScheduleResponse, error)
- func (s *BackupScheduler) Run(ctx context.Context)
- func (s *BackupScheduler) Upsert(ctx context.Context, request BackupScheduleRequest) (*BackupScheduleResponse, error)
- type BackupStorageConfig
- type CleanupRequest
- type CleanupResponse
- type ContainerSpec
- type ContainerStat
- type EnvBundleRequest
- type EnvBundleResponse
- type ExportDiscoveryRecord
- type ExportDiscoveryResponse
- type HealthSpec
- type ImageBuildResponse
- type ImageBuildTimings
- type ImageExistsResponse
- type ImageImportResponse
- type LeaseInfo
- type LeaseRequest
- type LeaseResponse
- type LogsRequest
- type MeshApplyRequest
- type MeshApplyResponse
- type MeshKeyResponse
- type MetadataRequest
- type MetadataResponse
- type MetricsResponse
- type NetworkAttachmentSpec
- type PortAllocationRequest
- type PortAllocationResponse
- type ProxyDynamicDomain
- type ProxyFileRequest
- type ProxyFileResponse
- type ProxyRoute
- type ProxyRouteHealth
- type ProxyRouteManifest
- type ReconcileProxyRequest
- type ReconcileProxyResponse
- type ReconcileServiceRequest
- type ReconcileServiceResponse
- type RemoveServiceRequest
- type RemoveServiceResponse
- type Server
- type ServerOptions
- type StateDocumentRequest
- type StateDocumentResponse
- func AppendStateEvent(ctx context.Context, dataDir string, req StateDocumentRequest) (*StateDocumentResponse, error)
- func DeleteStateDocument(ctx context.Context, dataDir string, req StateDocumentRequest) (*StateDocumentResponse, error)
- func ReadStateDocument(ctx context.Context, dataDir string, req StateDocumentRequest) (*StateDocumentResponse, error)
- func WriteStateDocument(ctx context.Context, dataDir string, req StateDocumentRequest) (*StateDocumentResponse, error)
- type StatsRequest
- type StatsResponse
- type Status
Constants ¶
View Source
const ( BackupDir = "/var/lib/tako/backups" DefaultRetention = 7 )
View Source
const ( BackupStorageProviderS3 = "s3" BackupStorageProviderR2 = "r2" BackupStorageProviderS3Compatible = "s3-compatible" )
View Source
const (
PortAllocationKindMeshUpstream = "mesh-upstream"
)
Variables ¶
This section is empty.
Functions ¶
func CleanupBackupObjects ¶ added in v0.5.4
func CleanupBackupObjects(ctx context.Context, storage BackupStorageConfig, retention BackupObjectRetention) error
func DeleteVolumeBackup ¶
func DeleteVolumeBackup(ctx context.Context, req BackupRequest) error
func ReadMeshStatus ¶
func ReleaseServicePortAllocationsExceptRevision ¶ added in v0.5.4
func RestoreVolumeBackup ¶
func RestoreVolumeBackup(ctx context.Context, req BackupRequest) error
func StreamProxyAccessLogs ¶
func StreamServiceLogs ¶
func ValidateBackupStorage ¶ added in v0.5.4
func ValidateBackupStorage(storage BackupStorageConfig) error
Types ¶
type ActualRefreshTarget ¶
func ListActualRefreshTargets ¶
func ListActualRefreshTargets(dataDir string) ([]ActualRefreshTarget, error)
type ActualService ¶
type ActualService struct {
Name string `json:"name"`
Image string `json:"image,omitempty"`
RevisionImages map[string]string `json:"revisionImages,omitempty"`
Replicas int `json:"replicas"`
Containers []string `json:"containers,omitempty"`
ConfigHash string `json:"configHash,omitempty"`
RuntimeID string `json:"runtimeId,omitempty"`
Persistent bool `json:"persistent,omitempty"`
CurrentRevision string `json:"currentRevision,omitempty"`
PreviousRevision string `json:"previousRevision,omitempty"`
WarmingRevisions []string `json:"warmingRevisions,omitempty"`
DeployStrategy string `json:"deployStrategy,omitempty"`
ActiveContainers []string `json:"activeContainers,omitempty"`
WarmingContainers []string `json:"warmingContainers,omitempty"`
}
type ActualStateResponse ¶
type ActualStateResponse struct {
Project string `json:"project"`
Environment string `json:"environment"`
Services map[string]*ActualService `json:"services"`
}
func GatherActualState ¶
func ParseActualState ¶
func ParseActualState(project string, environment string, dockerPSOutput string) *ActualStateResponse
type BackupCleanupResponse ¶
type BackupCleanupResponse struct {
Deleted int `json:"deleted"`
}
func CleanupOldBackups ¶
func CleanupOldBackups(ctx context.Context, req BackupRequest) (*BackupCleanupResponse, error)
type BackupInfo ¶
type BackupInfo struct {
ID string `json:"id"`
Service string `json:"service,omitempty"`
Volume string `json:"volume"`
Size int64 `json:"size"`
CreatedAt time.Time `json:"createdAt"`
Path string `json:"path"`
Compression string `json:"compression"`
Remote *BackupRemoteInfo `json:"remote,omitempty"`
}
func CreateVolumeBackup ¶
func CreateVolumeBackup(ctx context.Context, req BackupRequest) (*BackupInfo, error)
type BackupListResponse ¶
type BackupListResponse struct {
Backups []BackupInfo `json:"backups"`
}
func ListVolumeBackups ¶
func ListVolumeBackups(ctx context.Context, req BackupRequest) (*BackupListResponse, error)
type BackupObject ¶ added in v0.5.4
type BackupObjectRetention ¶ added in v0.5.4
type BackupRemoteInfo ¶ added in v0.5.4
type BackupRemoteInfo struct {
Provider string `json:"provider"`
Bucket string `json:"bucket"`
Key string `json:"key"`
Endpoint string `json:"endpoint,omitempty"`
}
func UploadBackupObject ¶ added in v0.5.4
func UploadBackupObject(ctx context.Context, storage BackupStorageConfig, object BackupObject) (*BackupRemoteInfo, error)
type BackupRequest ¶
type BackupRequest struct {
Project string `json:"project"`
Environment string `json:"environment"`
Volume string `json:"volume,omitempty"`
DockerVolume string `json:"dockerVolume,omitempty"`
ExternalVolume bool `json:"externalVolume,omitempty"`
BackupID string `json:"backupId,omitempty"`
RetentionDays int `json:"retentionDays,omitempty"`
Storage *BackupStorageConfig `json:"storage,omitempty"`
}
type BackupScheduleRequest ¶ added in v0.5.4
type BackupScheduleRequest struct {
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
Schedule string `json:"schedule"`
RetentionDays int `json:"retentionDays,omitempty"`
Volumes []BackupScheduleVolume `json:"volumes"`
Storage *BackupStorageConfig `json:"storage,omitempty"`
}
type BackupScheduleResponse ¶ added in v0.5.4
type BackupScheduleVolume ¶ added in v0.5.4
type BackupScheduler ¶ added in v0.5.4
type BackupScheduler struct {
// contains filtered or unexported fields
}
func NewBackupScheduler ¶ added in v0.5.4
func NewBackupScheduler(dataDir string) *BackupScheduler
func (*BackupScheduler) Delete ¶ added in v0.5.4
func (s *BackupScheduler) Delete(ctx context.Context, project string, environment string, service string) (*BackupScheduleResponse, error)
func (*BackupScheduler) Run ¶ added in v0.5.4
func (s *BackupScheduler) Run(ctx context.Context)
func (*BackupScheduler) Upsert ¶ added in v0.5.4
func (s *BackupScheduler) Upsert(ctx context.Context, request BackupScheduleRequest) (*BackupScheduleResponse, error)
type BackupStorageConfig ¶ added in v0.5.4
type BackupStorageConfig struct {
Provider string `json:"provider,omitempty"`
Bucket string `json:"bucket,omitempty"`
Region string `json:"region,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Prefix string `json:"prefix,omitempty"`
AccessKeyID string `json:"accessKeyId,omitempty"`
SecretAccessKey string `json:"secretAccessKey,omitempty"`
SessionToken string `json:"sessionToken,omitempty"`
ForcePathStyle bool `json:"forcePathStyle,omitempty"`
}
type CleanupRequest ¶
type CleanupRequest struct {
Project string `json:"project"`
Environment string `json:"environment,omitempty"`
RemoveContainers bool `json:"removeContainers,omitempty"`
RemoveImages bool `json:"removeImages,omitempty"`
RemoveNetworks bool `json:"removeNetworks,omitempty"`
RemoveDeployFiles bool `json:"removeDeployFiles,omitempty"`
RemoveTakodState bool `json:"removeTakodState,omitempty"`
ProxyFiles []string `json:"proxyFiles,omitempty"`
ExternalVolumes []string `json:"externalVolumes,omitempty"`
PruneDocker bool `json:"pruneDocker,omitempty"`
ImageRepositories []string `json:"imageRepositories,omitempty"`
KeepImages int `json:"keepImages,omitempty"`
CleanOldImages bool `json:"cleanOldImages,omitempty"`
CleanStoppedContainers bool `json:"cleanStoppedContainers,omitempty"`
CleanDanglingImages bool `json:"cleanDanglingImages,omitempty"`
CleanBuildCache bool `json:"cleanBuildCache,omitempty"`
CleanUnusedVolumes bool `json:"cleanUnusedVolumes,omitempty"`
SecureLogPermissions bool `json:"secureLogPermissions,omitempty"`
}
type CleanupResponse ¶
type CleanupResponse struct {
Project string `json:"project"`
Environment string `json:"environment,omitempty"`
ContainersRemoved int `json:"containersRemoved,omitempty"`
ImagesRemoved int `json:"imagesRemoved,omitempty"`
NetworksRemoved int `json:"networksRemoved,omitempty"`
ProxyFilesRemoved int `json:"proxyFilesRemoved,omitempty"`
BuildCacheCleaned bool `json:"buildCacheCleaned,omitempty"`
UnusedVolumesCleaned bool `json:"unusedVolumesCleaned,omitempty"`
LogPermissionsSecured bool `json:"logPermissionsSecured,omitempty"`
InitialDiskUsage string `json:"initialDiskUsage,omitempty"`
FinalDiskUsage string `json:"finalDiskUsage,omitempty"`
DockerDiskUsage string `json:"dockerDiskUsage,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
func CleanupProject ¶
func CleanupProject(ctx context.Context, req CleanupRequest) (*CleanupResponse, error)
type ContainerSpec ¶
type ContainerStat ¶
type EnvBundleRequest ¶
type EnvBundleResponse ¶
type EnvBundleResponse struct {
Found bool `json:"found"`
Content string `json:"content,omitempty"`
Path string `json:"path,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
func ReadEnvBundle ¶
func ReadEnvBundle(ctx context.Context, dataDir string, req EnvBundleRequest) (*EnvBundleResponse, error)
func WriteEnvBundle ¶
func WriteEnvBundle(ctx context.Context, dataDir string, req EnvBundleRequest) (*EnvBundleResponse, error)
type ExportDiscoveryRecord ¶ added in v0.4.35
type ExportDiscoveryResponse ¶ added in v0.4.35
type ExportDiscoveryResponse struct {
Exports []ExportDiscoveryRecord `json:"exports"`
}
func ListExportDiscovery ¶ added in v0.4.35
func ListExportDiscovery(ctx context.Context, environment string) (*ExportDiscoveryResponse, error)
type HealthSpec ¶
type HealthSpec struct {
Command string `json:"command,omitempty"`
Path string `json:"path,omitempty"`
Port int `json:"port,omitempty"`
Scheme string `json:"scheme,omitempty"`
Interval string `json:"interval,omitempty"`
Timeout string `json:"timeout,omitempty"`
Retries int `json:"retries,omitempty"`
StartPeriod string `json:"startPeriod,omitempty"`
WaitAttempts int `json:"waitAttempts,omitempty"`
SmokePath string `json:"smokePath,omitempty"`
SmokePort int `json:"smokePort,omitempty"`
SmokeExpectedStatus int `json:"smokeExpectedStatus,omitempty"`
}
type ImageBuildResponse ¶
type ImageBuildResponse struct {
Image string `json:"image"`
Output string `json:"output,omitempty"`
Timings *ImageBuildTimings `json:"timings,omitempty"`
}
func BuildImage ¶
type ImageBuildTimings ¶ added in v0.5.4
type ImageExistsResponse ¶
func ImageExists ¶
func ImageExists(ctx context.Context, image string) (*ImageExistsResponse, error)
type ImageImportResponse ¶
type ImageImportResponse struct {
Image string `json:"image"`
Output string `json:"output,omitempty"`
}
func ImportImage ¶
type LeaseRequest ¶
type LeaseResponse ¶
type LeaseResponse struct {
Acquired bool `json:"acquired"`
Found bool `json:"found"`
Lease *LeaseInfo `json:"lease,omitempty"`
Message string `json:"message,omitempty"`
}
func AcquireLease ¶
func AcquireLease(ctx context.Context, dataDir string, req LeaseRequest) (*LeaseResponse, error)
func ReadLease ¶
func ReadLease(ctx context.Context, dataDir string, req LeaseRequest) (*LeaseResponse, error)
func ReleaseLease ¶
func ReleaseLease(ctx context.Context, dataDir string, req LeaseRequest) (*LeaseResponse, error)
type LogsRequest ¶
type MeshApplyRequest ¶
type MeshApplyResponse ¶
type MeshApplyResponse struct {
Applied bool `json:"applied"`
Status *mesh.Status `json:"status,omitempty"`
}
func ReconcileMesh ¶
func ReconcileMesh(ctx context.Context, request MeshApplyRequest) (*MeshApplyResponse, error)
type MeshKeyResponse ¶
type MeshKeyResponse struct {
PublicKey string `json:"publicKey"`
}
func EnsureMeshKey ¶
func EnsureMeshKey(ctx context.Context) (*MeshKeyResponse, error)
type MetadataRequest ¶
type MetadataResponse ¶
type MetadataResponse struct {
NodePath string `json:"nodePath,omitempty"`
PeersPath string `json:"peersPath,omitempty"`
}
func WriteMetadata ¶
func WriteMetadata(ctx context.Context, dataDir string, req MetadataRequest) (*MetadataResponse, error)
type MetricsResponse ¶
type MetricsResponse struct {
Collected bool `json:"collected"`
Metrics json.RawMessage `json:"metrics"`
}
func ReadNodeMetrics ¶
func ReadNodeMetrics(ctx context.Context, collect bool) (*MetricsResponse, error)
type NetworkAttachmentSpec ¶ added in v0.4.12
type PortAllocationRequest ¶
type PortAllocationRequest struct {
Kind string `json:"kind"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
Revision string `json:"revision,omitempty"`
Slot int `json:"slot"`
HostIP string `json:"hostIp"`
ContainerPort int `json:"containerPort"`
PreferredPort int `json:"preferredPort"`
MinPort int `json:"minPort"`
MaxPort int `json:"maxPort"`
}
type PortAllocationResponse ¶
type PortAllocationResponse struct {
Kind string `json:"kind"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
Revision string `json:"revision,omitempty"`
Slot int `json:"slot"`
HostIP string `json:"hostIp"`
HostPort int `json:"hostPort"`
ContainerPort int `json:"containerPort"`
Key string `json:"key"`
}
func AllocatePort ¶
func AllocatePort(ctx context.Context, dataDir string, req PortAllocationRequest) (*PortAllocationResponse, error)
type ProxyDynamicDomain ¶ added in v0.5.0
type ProxyDynamicDomain struct {
AskURL string `json:"askUrl"`
}
type ProxyFileRequest ¶
type ProxyFileResponse ¶
type ProxyFileResponse struct {
Path string `json:"path"`
}
func RemoveProxyFile ¶
func RemoveProxyFile(ctx context.Context, name string) (*ProxyFileResponse, error)
func WriteProxyFile ¶
func WriteProxyFile(ctx context.Context, req ProxyFileRequest) (*ProxyFileResponse, error)
type ProxyRoute ¶ added in v0.5.0
type ProxyRoute struct {
Service string `json:"service"`
Revision string `json:"revision,omitempty"`
Domains []string `json:"domains,omitempty"`
RedirectFrom []string `json:"redirectFrom,omitempty"`
Upstreams []string `json:"upstreams"`
HealthCheck *ProxyRouteHealth `json:"healthCheck,omitempty"`
Sticky bool `json:"sticky,omitempty"`
Priority int `json:"priority,omitempty"`
DynamicDomain *ProxyDynamicDomain `json:"dynamicDomain,omitempty"`
}
type ProxyRouteHealth ¶ added in v0.5.0
type ProxyRouteManifest ¶ added in v0.5.0
type ProxyRouteManifest struct {
Version int `json:"version"`
Project string `json:"project"`
Environment string `json:"environment"`
Network string `json:"network,omitempty"`
Routes []ProxyRoute `json:"routes"`
}
func ParseProxyRouteManifest ¶ added in v0.5.0
func ParseProxyRouteManifest(content string) (*ProxyRouteManifest, error)
type ReconcileProxyRequest ¶
type ReconcileProxyResponse ¶
type ReconcileProxyResponse struct {
Container string `json:"container"`
Image string `json:"image"`
}
func ReconcileProxy ¶
func ReconcileProxy(ctx context.Context, req ReconcileProxyRequest) (*ReconcileProxyResponse, error)
type ReconcileServiceRequest ¶
type ReconcileServiceRequest struct {
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
Revision string `json:"revision,omitempty"`
DeployStrategy string `json:"deployStrategy,omitempty"`
Image string `json:"image"`
PullImage bool `json:"pullImage,omitempty"`
Restart string `json:"restart,omitempty"`
Network string `json:"network"`
NetworkAlias string `json:"networkAlias,omitempty"`
NetworkAttachments []NetworkAttachmentSpec `json:"networkAttachments,omitempty"`
EnvFile string `json:"envFile,omitempty"`
EnvFileContent string `json:"envFileContent,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Mounts []string `json:"mounts,omitempty"`
ExternalVolumes []string `json:"externalVolumes,omitempty"`
Containers []ContainerSpec `json:"containers"`
Health *HealthSpec `json:"health,omitempty"`
Command string `json:"command,omitempty"`
}
type ReconcileServiceResponse ¶
type ReconcileServiceResponse struct {
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
Containers []string `json:"containers"`
RemovedContainers int `json:"removedContainers,omitempty"`
}
func ReconcileService ¶
func ReconcileService(ctx context.Context, req ReconcileServiceRequest) (*ReconcileServiceResponse, error)
type RemoveServiceRequest ¶
type RemoveServiceResponse ¶
type RemoveServiceResponse struct {
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
RemovedContainers int `json:"removedContainers"`
}
func RemoveService ¶
func RemoveService(ctx context.Context, req RemoveServiceRequest) (*RemoveServiceResponse, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServerWithOptions ¶
func NewServerWithOptions(socket string, dataDir string, version string, opts ServerOptions) *Server
type ServerOptions ¶
type StateDocumentRequest ¶
type StateDocumentResponse ¶
type StateDocumentResponse struct {
Found bool `json:"found"`
Content string `json:"content,omitempty"`
Path string `json:"path,omitempty"`
}
func AppendStateEvent ¶
func AppendStateEvent(ctx context.Context, dataDir string, req StateDocumentRequest) (*StateDocumentResponse, error)
func DeleteStateDocument ¶ added in v0.4.8
func DeleteStateDocument(ctx context.Context, dataDir string, req StateDocumentRequest) (*StateDocumentResponse, error)
func ReadStateDocument ¶
func ReadStateDocument(ctx context.Context, dataDir string, req StateDocumentRequest) (*StateDocumentResponse, error)
func WriteStateDocument ¶
func WriteStateDocument(ctx context.Context, dataDir string, req StateDocumentRequest) (*StateDocumentResponse, error)
type StatsRequest ¶
type StatsResponse ¶
type StatsResponse struct {
Stats []ContainerStat `json:"stats"`
}
func ReadContainerStats ¶
func ReadContainerStats(ctx context.Context, req StatsRequest) (*StatsResponse, error)
type Status ¶
type Status struct {
Runtime string `json:"runtime"`
Version string `json:"version"`
Hostname string `json:"hostname"`
Socket string `json:"socket"`
DataDir string `json:"dataDir"`
StartedAt time.Time `json:"startedAt"`
Now time.Time `json:"now"`
Node map[string]any `json:"node,omitempty"`
Peers map[string]any `json:"peers,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.