model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ResourceTypeRepositories ResourceType = "repository"
	ResourceTypeCharts       ResourceType = "charts"
	ResourceTypeChart        ResourceType = "chart"
	ResourceTypeKubeFiles    ResourceType = "kubefiles"
	ResourceTypeKubeFile     ResourceType = "kubefile"
	ResourceTypeDeploys      ResourceType = "deploys"
	ResourceTypeDeploy       ResourceType = "deploy"
	ResourceTypeJobs         ResourceType = "jobs"
	ResourceTypeJob          ResourceType = "job"
	ResourceTypeProjects     ResourceType = "projects"
	ResourceTypeProject      ResourceType = "project"

	AggregatorEq      Aggregator = "eq"
	AggregatorIn      Aggregator = "in"
	AggregatorLike    Aggregator = "like"
	AggregatorNeq     Aggregator = "neq"
	AggregatorNotIn   Aggregator = "nin"
	AggregatorNotLike Aggregator = "nlike"
	AggregatorNot     Aggregator = "not" //for bool

	OperOr   Oper = "or"
	OperAnd  Oper = "and"
	OperNor  Oper = "nor"
	OperNAnd Oper = "nand"

	StateCreated  State = "created"
	StateError    State = "error"
	StateReady    State = "ready"
	StateRunning  State = "running"
	StateComplete State = "complete"
	StateFailed   State = "failed"
	StateRollback State = "rolled-back"
	StateDeleting State = "deleting"
	StateDeleted  State = "deleted"
	StatePurging  State = "purging"
	StatePutged   State = "purged"
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string, name string, config interface{}) error

func SaveConfig

func SaveConfig(path string, name string, config interface{}) error

Types

type Action

type Action string
const (
	GetResoource    Action = "GET"
	AddResoource    Action = "ADD"
	UpdateResoource Action = "UPDATE"
	DeleteResoource Action = "DELETE"
)

func (Action) Equals

func (a Action) Equals(act Action) bool

func (Action) Same

func (a Action) Same(act string) bool

func (Action) String

func (a Action) String(act string) string

type Aggregator

type Aggregator string

type ApiReference

type ApiReference struct {
	CurrentUrl    string             `yaml:"_self" json:"_self" xml:"self"`
	CurrentMethod string             `yaml:"_method" json:"_method" xml:"method"`
	Urls          []ApiReferenceItem `yaml:"urls" json:"urls" xml:"url"`
}

type ApiReferenceItem

type ApiReferenceItem struct {
	Name string `yaml:"name" json:"name" xml:"name"`
	Url  string `yaml:"url" json:"url" xml:"url"`
}

type ArgumentsList

type ArgumentsList []string

func (*ArgumentsList) Get

func (i *ArgumentsList) Get(index int) string

func (*ArgumentsList) Set

func (i *ArgumentsList) Set(value string) error

func (*ArgumentsList) String

func (i *ArgumentsList) String() string

type Chart

type Chart struct {
	Id       string    `yaml:"id" json:"id" xml:"id"`
	Name     string    `yaml:"name" json:"name" xml:"name"`
	Versions []Version `yaml:"versions" json:"versions" xml:"version"`
	State    State     `yaml:"state" json:"state" xml:"state"`
}

func (*Chart) String

func (ch *Chart) String() string

func (*Chart) ToJson

func (ch *Chart) ToJson() (string, error)

type DataManager

type DataManager struct {
	// Manage Repositories Data
	Repos RepositoryDataManager
	// Manage Projects Data
	Projects ProjectDataManager
	// Manage Deploys Data
	Deploys DeployDataManager
}

Represents the global data storage manager

type DataResponse

type DataResponse struct {
	// Success state flag
	Success bool
	// Error message
	Message string
	// Number of changes in the data operation
	Changes int64
	// Created, Modified or Deleted objects
	ResponseObjects []interface{}
}

Represents the data interaction response structure

type Deploy

type Deploy struct {
	Id    string `yaml:"id" json:"id" xml:"id"`
	Name  string `yaml:"name" json:"name" xml:"name"`
	Job   []Job  `yaml:"jobs" json:"jobs" xml:"job"`
	State State  `yaml:"state" json:"state" xml:"state"`
}

func (*Deploy) String

func (d *Deploy) String() string

func (*Deploy) ToJson

func (d *Deploy) ToJson() (string, error)

type DeployDataManager

type DeployDataManager interface {
	// List all Deploys
	ListDeploys() DataResponse
	// Add new Deploy
	AddDeploy(d Deploy) DataResponse
	// Delete existing Deploy
	DeleteDeploys(q ...Query) DataResponse
	// Purge one or more Deploys
	PurgeDeploys(q ...Query) DataResponse
	// Clear Deploys data selecting by id
	ClearDeploy(id string) DataResponse
	// Clear Deploys data selecting by name
	ClearDeployByName(name string) DataResponse
	// Get Deploy selecting by id
	GetDeploy(id string) *Deploy
	// Get Deploy selecting by name
	GetDeployByName(name string) *Deploy
	// Access to deploy jobs data using model.JobsDataManager
	AccessDeploy(d Deploy) *JobsDataManager
	// Override existing Deploy selecting by Id
	OverrideDeploy(id string, d Deploy) DataResponse
}

Represents the deploys data storage manager

type DocumentsDataManager

type DocumentsDataManager interface {
	// Add new chart data
	AddChart(c Chart) DataResponse
	// Add new Kubefile data
	AddKubeFile(f KubeFile) DataResponse
	// Add new chart version data
	AddChartVersion(c Chart, v Version) DataResponse
	// Add new Kubefile version data
	AddKubeFileVersion(f KubeFile, v Version) DataResponse
	// Remove one or more Charts
	RemoveCharts(q ...Query) DataResponse
	// Remove one or more Kube-files
	RemoveKubeFiles(q ...Query) DataResponse
	// Remove one or more Chart versions
	RemoveChartVersions(c Chart, q ...Query) DataResponse
	// Remove one or more Kube-file versions
	RemoveKubeFileVersions(f KubeFile, q ...Query) DataResponse
	// Purge permanently one or more Charts
	PurgeCharts(q ...Query) DataResponse
	// Purge permanently one or more Kube-files
	PurgeKubeFiles(q ...Query) DataResponse
	// Purge permanently one or more Chart versions
	PurgeChartVersions(c Chart, q ...Query) DataResponse
	// Purge permanently one or more Kube-file versions
	PurgeKubeFileVersions(f KubeFile, q ...Query) DataResponse
	// Update an existing Charts
	UpdateCharts(c Chart, q ...Query) DataResponse
	// Update one or more Kube-files
	UpdateKubeFiles(f KubeFile, v Version, q ...Query) DataResponse
	// Update an existing Chart versions
	UpdateChartVersions(c Chart, v Version, q ...Query) DataResponse
	// Update one or more Kube-file versions
	UpdateKubeFileVersions(f KubeFile, v Version, q ...Query) DataResponse
	// Query over repository Charts
	QueryCharts(q ...Query) DataResponse
	// Query over repository Kube-files
	QueryKubeFiles(q ...Query) DataResponse
	// Query over repository Chart versions
	QueryChartVersions(c Chart, q ...Query) DataResponse
	// Query over repository Kube-file versions
	QueryKubeFileVersions(f KubeFile, q ...Query) DataResponse
	// List all repository Charts
	ListCharts() DataResponse
	// List all repository Kube-files
	ListKubeFiles() DataResponse
	// List repository Chart versions
	ListChartVersions(q ...Query) DataResponse
	// List all repository Kube-file versions
	ListKubeFileVersions(q ...Query) DataResponse
}

Represents the repository documents data storage manager

type Field

type Field string

func (Field) Equals

func (f Field) Equals(field Field) bool

type Filter

type Filter struct {
	Field   Field       `yaml:"field" json:"async" xml:"async"`
	Partial bool        `yaml:"partialMatch" json:"partialMatch" xml:"partial-match"`
	Value   interface{} `yaml:"value" json:"value" xml:"value"`
}

type Instance

type Instance struct {
	Id         string         `yaml:"id" json:"id" xml:"id"`
	Name       string         `yaml:"name" json:"name" xml:"name"`
	Version    ProjectVersion `yaml:"version" json:"version" xml:"version"`
	State      State          `yaml:"state" json:"state" xml:"state"`
	Parameters []Param        `yaml:"parameters,omitempty" json:"parameters,omitempty" xml:"parameter,omitempty"`
	// contains filtered or unexported fields
}

func (*Instance) GetValues

func (i *Instance) GetValues() []Value

func (*Instance) String

func (i *Instance) String() string

func (*Instance) ToJson

func (i *Instance) ToJson() (string, error)

type Job

type Job struct {
	ProjectId  string   `yaml:"projectId" json:"projectId" xml:"project-id"`
	VersionId  string   `yaml:"versionId" json:"versionId" xml:"version-id"`
	DocumentId string   `yaml:"documentId" json:"documentId" xml:"document-id"`
	IsChart    bool     `yaml:"isChart" json:"isChart" xml:"is-chart"`
	State      State    `yaml:"state" json:"state" xml:"state"`
	Instance   Instance `yaml:"instance" json:"instance" xml:"instance"`
}

func (*Job) String

func (j *Job) String() string

func (*Job) ToJson

func (j *Job) ToJson() (string, error)

type JobsDataManager

type JobsDataManager interface {
	//List all Deploy jobs
	ListJobs() DataResponse
	//Add new job to the Deploy
	AddJob(j Job) DataResponse
	//Delete one or jobs in a Deploy
	DeleteJobs(q ...Query) DataResponse
	//Purge definitely one or jobs in a Deploy
	PurgeJobs(q ...Query) DataResponse
	//Collect job data by job id
	GetJob(id string) *Job
	//Collect job data by job name
	GetJobByName(name string) *Job
	//Override existing job data in the Deploy
	OverrideJob(id string, j Job) DataResponse
}

Represents the deploy jobs data storage manager

type KubeFile

type KubeFile struct {
	Id       string    `yaml:"id" json:"id" xml:"id"`
	Name     string    `yaml:"name" json:"name" xml:"name"`
	Versions []Version `yaml:"versions" json:"versions" xml:"version"`
	State    State     `yaml:"state" json:"state" xml:"state"`
}

func (*KubeFile) String

func (kf *KubeFile) String() string

func (*KubeFile) ToJson

func (kf *KubeFile) ToJson() (string, error)

type KubeRepoConfig

type KubeRepoConfig struct {
	DataDirPath       string `yaml:"dataDir" json:"dataDir" xml:"data-dir"`
	ConfigDirPath     string `yaml:"configDir" json:"configDir" xml:"config-dir"`
	ListenIP          string `yaml:"listenIp" json:"listenIp" xml:"listen-ip"`
	ListenPort        int    `yaml:"listenPort" json:"listenPort" xml:"listen-port"`
	TlsCert           string `yaml:"tlsCertFilePath" json:"tlsCertFilePath" xml:"tls-cert-file-path"`
	TlsKey            string `yaml:"tlsKeyFilePath" json:"tlsKeyFilePath" xml:"tls-key-file-path"`
	EnableFileLogging bool   `yaml:"enableFileLogging" json:"enableFileLogging" xml:"enable-file-logging"`
	LogVerbosity      string `yaml:"logVerbosity" json:"logVerbosity" xml:"log-verbosity"`
	LogFilePath       string `yaml:"logFilePath" json:"logFilePath" xml:"log-file-path"`
	EnableLogRotate   bool   `yaml:"enableLogRotate" json:"enableLogRotate" xml:"enable-log-rotate"`
	LogMaxFileSize    int64  `yaml:"logMaxFileSize" json:"logMaxFileSize" xml:"log-max-file-size"`
	LogFileCount      int    `yaml:"logFileCount" json:"logFileCount" xml:"log-file-count"`
	MongoDbEnabled    bool   `yaml:"mongoDbEnabled" json:"mongoDbEnabled" xml:"mongo-db-enabled"`
	MongoDbHost       string `yaml:"mongoDbHost" json:"mongoDbHost" xml:"mongo-db-host"`
	MongoDbPort       int    `yaml:"mongoDbPort" json:"mongoDbPort" xml:"mongo-db-port"`
	MongoDbUser       string `yaml:"mongoDbUser" json:"mongoDbUser" xml:"mongo-db-user"`
	MongoDbPassword   string `yaml:"mongoDbPassword" json:"mongoDbPassword" xml:"mongo-db-password"`
	StorageNamePrefix string `yaml:"mongoDbPrefix" json:"mongoDbPrefix" xml:"mongo-db-prefix"`
}

func (KubeRepoConfig) ToJson

func (conf KubeRepoConfig) ToJson() string

func (KubeRepoConfig) ToXml

func (conf KubeRepoConfig) ToXml() string

func (KubeRepoConfig) ToYaml

func (conf KubeRepoConfig) ToYaml() string

type Oper

type Oper string

type Param

type Param struct {
	Name  string      `yaml:"name" json:"name" xml:"name"`
	Value interface{} `yaml:"value" json:"value" xml:"value"`
}

func (*Param) String

func (p *Param) String() string

func (*Param) ToJson

func (p *Param) ToJson() (string, error)

type Project

type Project struct {
	Id       string           `yaml:"id" json:"id" xml:"id"`
	Name     string           `yaml:"name" json:"name" xml:"name"`
	Version  string           `yaml:"version" json:"version" xml:"version"`
	Versions []ProjectVersion `yaml:"versions" json:"versions" xml:"version"`
	State    State            `yaml:"state" json:"state" xml:"state"`
	ReadOnly bool             `yaml:"readOnly" json:"readOnly" xml:"read-only"`
}

func (*Project) String

func (p *Project) String() string

func (*Project) ToJson

func (p *Project) ToJson() (string, error)

type ProjectChart

type ProjectChart struct {
	Id      string `yaml:"id" json:"id" xml:"id"`
	Name    string `yaml:"name" json:"name" xml:"name"`
	Version string `yaml:"version" json:"version" xml:"version"`
	State   State  `yaml:"state" json:"state" xml:"state"`
}

func (*ProjectChart) String

func (pch *ProjectChart) String() string

func (*ProjectChart) ToJson

func (pch *ProjectChart) ToJson() (string, error)

type ProjectDataManager

type ProjectDataManager interface {
	// List all projects
	ListProjects() DataResponse
	// Add a new project
	AddProject(p Project) DataResponse
	// Add a new version to a project
	AddProjectVersion(p Project, version ProjectVersion) DataResponse
	// Delete one ot more projects
	DeleteProjects(q ...Query) DataResponse
	// Delete one ot more project verions
	DeleteProjectVersions(p Project, q ...Query) DataResponse
	// Purge one ot more projects definitely
	PurgeProjects(q ...Query) DataResponse
	// Purge one ot more project versions definitely
	PurgeProjectVersions(p Project, q ...Query) DataResponse
	// Clear project information, selecting by id
	ClearProject(id string) DataResponse
	// Clear project information, selecting by name
	ClearProjectByName(name string) DataResponse
	// Collect project information, selecting by id
	GetProject(id string) *Project
	// Collect project information, selecting by name
	GetProjectByName(name string) *Project
	// Collect project versions information
	GetProjectVersions(p Project, q ...Query) *Project
	// Override project information
	OverrideProject(id string, p Project) DataResponse
	// Override project versions information
	OverrideProjectVersions(id string, v Version, q ...Query) DataResponse
	// Query over Projects
	QueryProjects(q ...Query) DataResponse
	// Query over Project versions
	QueryProjectVersions(c Chart, q ...Query) DataResponse
}

Represents the projects data storage manager

type ProjectKubeFile

type ProjectKubeFile struct {
	Id      string `yaml:"id" json:"id" xml:"id"`
	Name    string `yaml:"name" json:"name" xml:"name"`
	Version string `yaml:"version" json:"version" xml:"version"`
	State   State  `yaml:"state" json:"state" xml:"state"`
}

func (*ProjectKubeFile) String

func (pkf *ProjectKubeFile) String() string

func (*ProjectKubeFile) ToJson

func (pkf *ProjectKubeFile) ToJson() (string, error)

type ProjectVersion

type ProjectVersion struct {
	Version   string            `yaml:"version" json:"version" xml:"version"`
	Charts    []ProjectChart    `yaml:"charts" json:"charts" xml:"chart"`
	KubeFiles []ProjectKubeFile `yaml:"kubefiles" json:"kubefiles" xml:"kubefile"`
	Variables []Variable        `yaml:"variables" json:"variables" xml:"variables"`
	State     State             `yaml:"state" json:"state" xml:"state"`
}

func (*ProjectVersion) String

func (pv *ProjectVersion) String() string

func (*ProjectVersion) ToJson

func (pv *ProjectVersion) ToJson() (string, error)

type Query

type Query struct {
	Items []QueryItem `yaml:"items" json:"items" xml:"item"`
	Oper  Oper        `yaml:"oper" json:"oper" xml:"oper"`
}

func (*Query) ToJson

func (q *Query) ToJson() (string, error)

type QueryItem

type QueryItem struct {
	Key        string     `yaml:"key" json:"key" xml:"key"`
	Value      string     `yaml:"value" json:"value" xml:"value"`
	Aggregator Aggregator `yaml:"aggregator" json:"aggregator" xml:"aggregator"`
}

func (*QueryItem) String

func (q *QueryItem) String() string

func (*QueryItem) ToJson

func (q *QueryItem) ToJson() (string, error)

type Repository

type Repository struct {
	Id        string     `yaml:"id" json:"id" xml:"id"`
	Name      string     `yaml:"name" json:"name" xml:"name"`
	Charts    []Chart    `yaml:"charts" json:"charts" xml:"chart"`
	KubeFiles []KubeFile `yaml:"kubefiles" json:"kubefiles" xml:"kubefile"`
	State     State      `yaml:"state" json:"state" xml:"state"`
}

func (*Repository) String

func (r *Repository) String() string

func (*Repository) ToJson

func (r *Repository) ToJson() (string, error)

type RepositoryDataManager

type RepositoryDataManager interface {
	//List all repositories
	ListRepositories() DataResponse
	//Add new repository
	AddRepository(r Repository) DataResponse
	//Delete one or more repositories
	DeleteRepositories(q ...Query) DataResponse
	//Purge data for one or more repositories
	PurgeRepositories(q ...Query) DataResponse
	//Clear a repositories data entities selecting by id
	ClearRepository(id string) DataResponse
	//Clear a repositories data entities selecting by name
	ClearRepositoryByName(name string) DataResponse
	//Collect a repository data entities selecting by id
	GetRepository(id string) *Repository
	//Collect a repository data entities selecting by name
	GetRepositoryByName(name string) *Repository
	//Access Repository data via model.DocumentsDataManager
	AccessRepository(r Repository) *DocumentsDataManager
	//Override a repository selecting via id
	OverrideRepository(id string, r Repository) DataResponse
}

Represents the repositories data storage manager

type Request

type Request struct {
	Resource ResourceType `yaml:"resourceType" json:"resourceType" xml:"resource-type"`
	Action   Action       `yaml:"action" json:"action" xml:"action"`
	Payload  interface{}  `yaml:"payload" json:"payload" xml:"payload"`
	Async    bool         `yaml:"async,omitempty" json:"async,omitempty" xml:"async,omitempty"`
	Filters  []Filter     `yaml:"filters,omitempty" json:"filters,omitempty" xml:"filter,omitempty"`
	Queries  []Query      `yaml:"queries,omitempty" json:"queries,omitempty" xml:"query,omitempty"`
}

func (*Request) String

func (req *Request) String() string

func (*Request) ToJson

func (req *Request) ToJson() (string, error)

type ResourceType

type ResourceType string

type Response

type Response struct {
	Status    int          `yaml:"status" json:"status" xml:"status"`
	Message   string       `yaml:"message" json:"message" xml:"message"`
	Reference ApiReference `yaml:"reference" json:"reference" xml:"reference"`
	Data      interface{}  `yaml:"data" json:"data" xml:"data"`
}

type State

type State string

type Value

type Value struct {
	Name  string      `yaml:"name" json:"name" xml:"name"`
	Value interface{} `yaml:"value" json:"value" xml:"value"`
	Valid bool        `yaml:"valid" json:"valid" xml:"valid"`
}

func (*Value) String

func (v *Value) String() string

func (*Value) ToJson

func (v *Value) ToJson() (string, error)

type Variable

type Variable struct {
	Id      string         `yaml:"id" json:"id" xml:"id"`
	Name    string         `yaml:"name" json:"name" xml:"name"`
	Default interface{}    `yaml:"default" json:"default" xml:"default"`
	Rules   []VariableRule `yaml:"rules" json:"rules" xml:"rules"`
}

func (*Variable) String

func (v *Variable) String() string

func (*Variable) ToJson

func (v *Variable) ToJson() (string, error)

type VariableRule

type VariableRule struct {
	Id        string `yaml:"id" json:"id" xml:"id"`
	Name      string `yaml:"name" json:"name" xml:"name"`
	ValidIf   string `yaml:"validif" json:"validif" xml:"valid-if"`
	InvalidIf string `yaml:"invalidif" json:"invalidif" xml:"invalid-if"`
}

func (*VariableRule) String

func (vr *VariableRule) String() string

func (*VariableRule) ToJson

func (vr *VariableRule) ToJson() (string, error)

type Version

type Version struct {
	Id    string `yaml:"id" json:"id" xml:"id"`
	Name  string `yaml:"name" json:"name" xml:"name"`
	State State  `yaml:"state" json:"state" xml:"state"`
}

func (*Version) String

func (ver *Version) String() string

func (*Version) ToJson

func (ver *Version) ToJson() (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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