application

package
v0.0.0-...-5615a53 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	ID           uint32        `json:"id"`
	Name         string        `json:"name"`
	Source       Source        `json:"source"`
	RefreshTimer string        `json:"refresh_timer"` // Timer to check for Sync format of "3m50s"
	Health       Health        `json:"health"`
	HealthStatus string        `json:"health_status"`
	CreatedAt    time.Time     `json:"created_at"`
	UpdatedAt    time.Time     `json:"updated_at"`
	LastSyncedAt time.Time     `json:"last_synced_at"`
	LiveState    string        `json:"-"`
	SyncTrigger  chan SyncType `json:"-"`
}

func New

func New(spec Spec) Application

func (*Application) Apply

func (app *Application) Apply(targetState string) error

func (*Application) GetState

func (app *Application) GetState() (string, error)

func (*Application) Run

func (app *Application) Run()

func (*Application) SyncStatus

func (app *Application) SyncStatus(targetState string) bool

SyncStatus Check if LiveState = TargetState

Whether or not the live state matches the target state. Is the deployed application the same as Git says it should be?

type Health

type Health int
const (
	Healthy Health = iota
	Progressing
	Degraded
	Suspended
)

func (Health) ToString

func (h Health) ToString() string

type Set

type Set struct {
	Applications []Application
}

type Source

type Source struct {
	RepoURL        string `json:"repoURL" yaml:"repoURL"`
	TargetRevision string `json:"targetRevision" yaml:"targetRevision"`
	Path           string `json:"path" yaml:"path"`
}

type Spec

type Spec struct {
	Name         string `json:"name" yaml:"name"`
	RefreshTimer string `json:"refresh_timer" yaml:"refresh_timer"` // number of minutes
	Source       Source `json:"source" yaml:"source"`
}

func ParseSpecFromFile

func ParseSpecFromFile(file string) (Spec, error)

parse an application from yaml source

func ParseSpecFromValue

func ParseSpecFromValue(name, repo, revision, path, refresh string) (Spec, error)

type SyncType

type SyncType int
const (
	Synchronize SyncType = iota
	UpdateSync
)

Jump to

Keyboard shortcuts

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