entity

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// ID is the id of the backend.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the backend.
	Name string `yaml:"name" json:"name"`
	// // Type is the type of the backend.
	// Type string `yaml:"type" json:"type"`
	// Backend is the configuration of the backend.
	BackendConfig v1.BackendConfig `yaml:"backendConfig" json:"backendConfig"`
	// Description is a human-readable description of the backend.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// CreationTimestamp is the timestamp of the created for the backend.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the backend.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Backend represents the specific configuration backend

func (*Backend) Validate

func (w *Backend) Validate() error

Validate checks if the backend is valid. It returns an error if the backend is not valid.

type GetConfig

type GetConfig struct {
	Paths []string
	Type  *constant.SourceProviderType
}

type GetOption

type GetOption func(opt *GetConfig)

func WithPaths

func WithPaths(paths ...string) GetOption

func WithType

type Organization

type Organization struct {
	// ID is the id of the organization.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the organization.
	Name string `yaml:"name" json:"name"`
	// DisplayName is the human-readable display name.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	// Description is a human-readable description of the organization.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Labels are custom labels associated with the organization.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the organization.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the organization.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the organization.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Organization represents the specific configuration organization

func (*Organization) Validate

func (p *Organization) Validate() error

Validate checks if the organization is valid. It returns an error if the organization is not valid.

type Project

type Project struct {
	// ID is the id of the project.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the project.
	Name string `yaml:"name" json:"name"`
	// DisplayName is the human-readable display name.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	// Source is the configuration source associated with the project.
	Source *Source `yaml:"source" json:"source"`
	// Organization is the configuration source associated with the project.
	Organization *Organization `yaml:"organization" json:"organization"`
	// Description is a human-readable description of the project.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Path is the relative path of the project within the sourcs.
	Path string `yaml:"path,omitempty" json:"path,omitempty"`
	// Labels are custom labels associated with the project.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the project.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the project.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the project.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Project represents the specific configuration project

func (*Project) ConvertToCore

func (p *Project) ConvertToCore() (*v1.Project, error)

Convert Project to core Project

func (*Project) Validate

func (p *Project) Validate() error

Validate checks if the project is valid. It returns an error if the project is not valid.

type Source

type Source struct {
	// ID is the id of the source.
	ID uint `yaml:"id" json:"id"`
	// SourceProvider is the type of the source provider.
	SourceProvider constant.SourceProviderType `yaml:"sourceProvider" json:"sourceProvider"`
	// Remote is the source URL, including scheme.
	Remote *url.URL `yaml:"remote" json:"remote"`
	// Description is a human-readable description of the source.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Labels are custom labels associated with the source.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the source.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the source.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the source.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Source represents the specific configuration code source, which should be a specific instance of the source provider.

func (*Source) Summary

func (s *Source) Summary() string

func (*Source) Validate

func (s *Source) Validate() error

Validate checks if the source is valid. It returns an error if the source is not valid.

type SourceProvider

type SourceProvider interface {
	// Get the type of the source provider.
	Type() constant.SourceProviderType
	// Get source and return directory.
	Get(ctx context.Context, opts ...GetOption) (string, error)
	// Cleanup is invoked to cleanup temp resources for the source.
	Cleanup(ctx context.Context)
}

The SourceProvider represents the abstraction of the source provider(s) management framework.

type Stack

type Stack struct {
	// ID is the id of the stack.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the stack.
	Name string `yaml:"name" json:"name"`
	// DisplayName is the human-readable display nams.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	// Source is the configuration source associated with the stack.
	// Source *Source `yaml:"source" json:"source"`
	// Project is the project associated with the stack.
	Project *Project `yaml:"project" json:"project"`
	// Org is the org associated with the stack.
	// Organization *Organization `yaml:"organization" json:"organization"`
	// Desired is the desired version of stack.
	DesiredVersion string `yaml:"desiredVersion" json:"desiredVersion"`
	// Description is a human-readable description of the stack.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Path is the relative path of the stack within the sourcs.
	Path string `yaml:"path,omitempty" json:"path,omitempty"`
	// Labels are custom labels associated with the stack.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the stack.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// SyncState is the current state of the stack.
	SyncState constant.StackState `yaml:"syncState" json:"syncState"`
	// LastSyncTimestamp is the timestamp of the last sync operation for the stack.
	LastSyncTimestamp time.Time `yaml:"lastSyncTimestamp,omitempty" json:"lastSyncTimestamp,omitempty"`
	// CreationTimestamp is the timestamp of the created for the stack.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the stack.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
}

Stack represents the specific configuration stack

func (*Stack) ConvertToCore

func (s *Stack) ConvertToCore() (*v1.Stack, error)

Convert stack to core stack

func (*Stack) Validate

func (s *Stack) Validate() error

Validate checks if the stack is valid. It returns an error if the stack is not valid.

type Workspace

type Workspace struct {
	// ID is the id of the workspace.
	ID uint `yaml:"id" json:"id"`
	// Name is the name of the workspace.
	Name string `yaml:"name" json:"name"`
	// DisplayName is the human-readable display name.
	DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
	// Description is a human-readable description of the workspace.
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Labels are custom labels associated with the workspace.
	Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
	// Owners is a list of owners for the workspace.
	Owners []string `yaml:"owners,omitempty" json:"owners,omitempty"`
	// CreationTimestamp is the timestamp of the created for the workspace.
	CreationTimestamp time.Time `yaml:"creationTimestamp,omitempty" json:"creationTimestamp,omitempty"`
	// UpdateTimestamp is the timestamp of the updated for the workspace.
	UpdateTimestamp time.Time `yaml:"updateTimestamp,omitempty" json:"updateTimestamp,omitempty"`
	// Backend is the corresponding backend for this workspace.
	Backend *Backend `yaml:"backend,omitempty" json:"backend,omitempty"`
}

Workspace represents the specific configuration workspace

func (*Workspace) Validate

func (w *Workspace) Validate() error

Validate checks if the workspace is valid. It returns an error if the workspace is not valid.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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