model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPending = "Pending"
	StatusSynced  = "Synced"
	StatusOutSync = "OutSync"
	StatusError   = "Error"
)
View Source
const (
	MessageSyncingUp = "Syncing up..."
	MessageSynced    = "Synced successfully"
)
View Source
const (
	CollectionName = "accounts"
)
View Source
const (
	FilePath = "resources/"
)

Variables

This section is empty.

Functions

func ConfigKeys

func ConfigKeys(configs []Config) []string

func GroupNames

func GroupNames(groups []Group) []string

func StrategyNames

func StrategyNames(strategies []Strategy) []string

Types

type Account

type Account struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"`
	Repository  string             `json:"repository"`
	Branch      string             `json:"branch"`
	Token       string             `json:"token"`
	Environment string             `json:"environment"`
	Domain      DomainDetails      `json:"domain"`
	Settings    Settings           `json:"settings"`
}

type Config

type Config struct {
	Key         string     `json:"key,omitempty"`
	Description string     `json:"description,omitempty"`
	Activated   *bool      `json:"activated,omitempty"`
	Strategies  []Strategy `json:"strategies,omitempty"`
	Components  []string   `json:"components,omitempty"`
}

func GetConfigByKey

func GetConfigByKey(configs []Config, key string) Config

type Data

type Data struct {
	Snapshot Snapshot `json:"data,omitempty"`
}

type DiffDetails

type DiffDetails struct {
	Action  string   `json:"action"`
	Diff    string   `json:"diff"`
	Path    []string `json:"path"`
	Content any      `json:"content"`
}

type DiffResult

type DiffResult struct {
	Environment string        `json:"environment,omitempty"`
	Changes     []DiffDetails `json:"changes"`
}

type Domain

type Domain struct {
	Group   []Group `json:"group,omitempty"`
	Version int     `json:"version,omitempty"`
}

type DomainDetails

type DomainDetails struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Version    int    `json:"version"`
	LastCommit string `json:"lastcommit"`
	LastDate   string `json:"lastdate"`
	Status     string `json:"status"`
	Message    string `json:"message"`
}

type Group

type Group struct {
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Activated   *bool    `json:"activated,omitempty"`
	Config      []Config `json:"config,omitempty"`
}

func GetGroupByName

func GetGroupByName(groups []Group, name string) Group

type RepositoryData

type RepositoryData struct {
	CommitHash string
	CommitDate string
	Content    string
}

type Settings

type Settings struct {
	Active     bool   `json:"active"`
	Window     string `json:"window"`
	ForcePrune bool   `json:"forceprune"`
}

type Snapshot

type Snapshot struct {
	Domain Domain `json:"domain,omitempty"`
}

type Strategy

type Strategy struct {
	Strategy  string   `json:"strategy,omitempty"`
	Activated *bool    `json:"activated,omitempty"`
	Operation string   `json:"operation,omitempty"`
	Values    []string `json:"values,omitempty"`
}

func GetStrategyByName

func GetStrategyByName(strategies []Strategy, name string) Strategy

Jump to

Keyboard shortcuts

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