storage

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilterEqual    = "="
	FilterNotEqual = "!="
)
View Source
const (
	QueryEqualWithParam = " (%s = ?) "
	QueryLess           = " (%s <= %s) "
	QueryGreater        = " (%s >= %d) "
	QueryLikeWithParam  = " (%s LIKE ?) "
	QueryInWithParam    = " (%s IN (?)) "
	QueryNotInWithParam = " (%s NOT IN (?)) "
	QueryIsNull         = " (%s IS NULL) "
	QueryAnd            = " AND "
	QueryOr             = " OR "

	CreatedAt     = "created_at"
	UpdatedAt     = "updated_at"
	Type          = "type"
	ServerAddress = "server_address"
	State         = "state"
	ID            = "id"
	FsID          = "fs_id"
	FsCacheID     = "cache_id"
	FsPath        = "fs_path"
	NodeName      = "nodename"
	ClusterID     = "cluster_id"
	Address       = "address"
	UserName      = "user_name"
	UserROOT      = "root"

	ASC  = "asc"
	DESC = "desc"
)

Variables

View Source
var (
	ClusterCache *gorm.DB

	NodeCache     NodeCacheInterface
	PodCache      PodCacheInterface
	ResourceCache ResourceCacheInterface
	LabelCache    LabelCacheInterface
)

Functions

func InitClusterCaches added in v0.14.6

func InitClusterCaches(db *gorm.DB)

func InitStores

func InitStores(db *gorm.DB)

func WithTransaction added in v0.14.4

func WithTransaction(tdb *gorm.DB, fn Transaction) (err error)

Types

type ArtifactStoreInterface added in v0.14.4

type ArtifactStoreInterface interface {
	CreateArtifactEvent(logEntry *log.Entry, artifact model.ArtifactEvent) error
	CountArtifactEvent(logEntry *log.Entry, fsID, artifactPath string) (int64, error)
	GetArtifactEvent(logEntry *log.Entry, runID, fsID, artifactPath string) (model.ArtifactEvent, error)
	UpdateArtifactEvent(logEntry *log.Entry, fsID, artifactPath string, artifact model.ArtifactEvent) error
	DeleteArtifactEvent(logEntry *log.Entry, username, fsname, runID, artifactPath string) error
	ListArtifactEvent(logEntry *log.Entry, pk int64, maxKeys int, userFilter, fsFilter, runFilter, typeFilter, pathFilter []string) ([]model.ArtifactEvent, error)
	GetLastArtifactEvent(logEntry *log.Entry) (model.ArtifactEvent, error)
}

type AuthStore

type AuthStore struct {
	// contains filtered or unexported fields
}

func (*AuthStore) CreateGrant

func (as *AuthStore) CreateGrant(ctx *logger.RequestContext, grant *model.Grant) error

func (*AuthStore) CreateUser

func (as *AuthStore) CreateUser(ctx *logger.RequestContext, user *model.User) error

func (*AuthStore) DeleteGrant

func (as *AuthStore) DeleteGrant(ctx *logger.RequestContext, userName, resourceType, resourceID string) error

func (*AuthStore) DeleteGrantByResourceID

func (as *AuthStore) DeleteGrantByResourceID(ctx *logger.RequestContext, resourceID string) error

func (*AuthStore) DeleteGrantByUserName

func (as *AuthStore) DeleteGrantByUserName(ctx *logger.RequestContext, userName string) error

func (*AuthStore) DeleteUser

func (as *AuthStore) DeleteUser(ctx *logger.RequestContext, userName string) error

func (*AuthStore) GetGrant

func (as *AuthStore) GetGrant(ctx *logger.RequestContext, userName, resourceType, resourceID string) (*model.Grant, error)

func (*AuthStore) GetLastGrant

func (as *AuthStore) GetLastGrant(ctx *logger.RequestContext) (model.Grant, error)

func (*AuthStore) GetLastUser

func (as *AuthStore) GetLastUser(ctx *logger.RequestContext) (model.User, error)

func (*AuthStore) GetUserByName

func (as *AuthStore) GetUserByName(ctx *logger.RequestContext, userName string) (model.User, error)

func (*AuthStore) HasAccessToResource

func (as *AuthStore) HasAccessToResource(ctx *logger.RequestContext, resourceType string, resourceID string) bool

func (*AuthStore) ListGrant

func (as *AuthStore) ListGrant(ctx *logger.RequestContext, pk int64, maxKeys int, userName string) ([]model.Grant, error)

func (*AuthStore) ListUser

func (as *AuthStore) ListUser(ctx *logger.RequestContext, pk int64, maxKey int) ([]model.User, error)

func (*AuthStore) UpdateUser

func (as *AuthStore) UpdateUser(ctx *logger.RequestContext, userName, password string) error

type AuthStoreInterface

type AuthStoreInterface interface {
	// user
	CreateUser(ctx *logger.RequestContext, user *model.User) error
	UpdateUser(ctx *logger.RequestContext, userName, password string) error
	ListUser(ctx *logger.RequestContext, pk int64, maxKey int) ([]model.User, error)
	DeleteUser(ctx *logger.RequestContext, userName string) error
	GetUserByName(ctx *logger.RequestContext, userName string) (model.User, error)
	GetLastUser(ctx *logger.RequestContext) (model.User, error)
	// grant
	CreateGrant(ctx *logger.RequestContext, grant *model.Grant) error
	DeleteGrant(ctx *logger.RequestContext, userName, resourceType, resourceID string) error
	GetGrant(ctx *logger.RequestContext, userName, resourceType, resourceID string) (*model.Grant, error)
	HasAccessToResource(ctx *logger.RequestContext, resourceType string, resourceID string) bool
	DeleteGrantByUserName(ctx *logger.RequestContext, userName string) error
	DeleteGrantByResourceID(ctx *logger.RequestContext, resourceID string) error
	ListGrant(ctx *logger.RequestContext, pk int64, maxKeys int, userName string) ([]model.Grant, error)
	GetLastGrant(ctx *logger.RequestContext) (model.Grant, error)
}

type ClusterNodeCache added in v0.14.6

type ClusterNodeCache struct {
	// contains filtered or unexported fields
}

func (*ClusterNodeCache) AddNode added in v0.14.6

func (nc *ClusterNodeCache) AddNode(nodeInfo *model.NodeInfo) error

func (*ClusterNodeCache) DeleteNode added in v0.14.6

func (nc *ClusterNodeCache) DeleteNode(nodeID string) error

func (*ClusterNodeCache) GetNode added in v0.14.6

func (nc *ClusterNodeCache) GetNode(nodeID string) (model.NodeInfo, error)

func (*ClusterNodeCache) ListNode added in v0.14.6

func (nc *ClusterNodeCache) ListNode(clusterNames []string, labels string, limit, offset int) ([]model.NodeInfo, error)

func (*ClusterNodeCache) UpdateNode added in v0.14.6

func (nc *ClusterNodeCache) UpdateNode(nodeID string, nodeInfo *model.NodeInfo) error

type ClusterPodCache added in v0.14.6

type ClusterPodCache struct {
	// contains filtered or unexported fields
}

func (*ClusterPodCache) AddPod added in v0.14.6

func (cpc *ClusterPodCache) AddPod(podInfo *model.PodInfo) error

func (*ClusterPodCache) DeletePod added in v0.14.6

func (cpc *ClusterPodCache) DeletePod(podID string) error

func (*ClusterPodCache) GetPod added in v0.14.6

func (cpc *ClusterPodCache) GetPod(podID string) (model.PodInfo, error)

func (*ClusterPodCache) UpdatePod added in v0.14.6

func (cpc *ClusterPodCache) UpdatePod(podID string, podInfo *model.PodInfo) error

type ClusterStore added in v0.14.4

type ClusterStore struct {
	// contains filtered or unexported fields
}

func (*ClusterStore) ActiveClusters added in v0.14.4

func (cs *ClusterStore) ActiveClusters() []model.ClusterInfo

func (*ClusterStore) CreateCluster added in v0.14.4

func (cs *ClusterStore) CreateCluster(clusterInfo *model.ClusterInfo) error

func (*ClusterStore) DeleteCluster added in v0.14.4

func (cs *ClusterStore) DeleteCluster(clusterName string) error

func (*ClusterStore) GetClusterById added in v0.14.4

func (cs *ClusterStore) GetClusterById(clusterId string) (model.ClusterInfo, error)

func (*ClusterStore) GetClusterByName added in v0.14.4

func (cs *ClusterStore) GetClusterByName(clusterName string) (model.ClusterInfo, error)

func (*ClusterStore) GetLastCluster added in v0.14.4

func (cs *ClusterStore) GetLastCluster() (model.ClusterInfo, error)

func (*ClusterStore) ListCluster added in v0.14.4

func (cs *ClusterStore) ListCluster(pk int64, maxKeys int, clusterNameList []string, clusterStatus string) ([]model.ClusterInfo, error)

func (*ClusterStore) UpdateCluster added in v0.14.4

func (cs *ClusterStore) UpdateCluster(clusterId string, clusterInfo *model.ClusterInfo) error

type ClusterStoreInterface added in v0.14.4

type ClusterStoreInterface interface {
	CreateCluster(clusterInfo *model.ClusterInfo) error
	ListCluster(pk int64, maxKeys int, clusterNameList []string, clusterStatus string) ([]model.ClusterInfo, error)
	GetLastCluster() (model.ClusterInfo, error)
	GetClusterByName(clusterName string) (model.ClusterInfo, error)
	GetClusterById(clusterId string) (model.ClusterInfo, error)
	DeleteCluster(clusterName string) error
	UpdateCluster(clusterId string, clusterInfo *model.ClusterInfo) error
	ActiveClusters() []model.ClusterInfo
}

type ConcurrentFSCacheMap

type ConcurrentFSCacheMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*ConcurrentFSCacheMap) Delete

func (cm *ConcurrentFSCacheMap) Delete(key1, key2 string) error

func (*ConcurrentFSCacheMap) Get

func (cm *ConcurrentFSCacheMap) Get(key1, key2 string) *model.FSCache

func (*ConcurrentFSCacheMap) GetBatch

func (cm *ConcurrentFSCacheMap) GetBatch(key string) []model.FSCache

func (*ConcurrentFSCacheMap) Put

func (cm *ConcurrentFSCacheMap) Put(key string, value *model.FSCache)

func (*ConcurrentFSCacheMap) Update

func (cm *ConcurrentFSCacheMap) Update(key string, value *model.FSCache) (has bool, err error)

type DBFSCache

type DBFSCache struct {
	// contains filtered or unexported fields
}

func (*DBFSCache) Add

func (f *DBFSCache) Add(value *model.FSCache) error

func (*DBFSCache) Delete

func (f *DBFSCache) Delete(fsID, cacheID string) error

func (*DBFSCache) Get

func (f *DBFSCache) Get(fsID string, cacheID string) (*model.FSCache, error)

func (*DBFSCache) List

func (f *DBFSCache) List(fsID, cacheID string) ([]model.FSCache, error)

func (*DBFSCache) ListNodes

func (f *DBFSCache) ListNodes(fsIDs []string) ([]string, error)

func (*DBFSCache) Update

func (f *DBFSCache) Update(value *model.FSCache) (int64, error)

type FileSystemStoreInterface

type FileSystemStoreInterface interface {
	// filesystem
	CreatFileSystem(fs *model.FileSystem) error
	GetFileSystemWithFsID(fsID string) (model.FileSystem, error)
	DeleteFileSystem(tx *gorm.DB, id string) error
	ListFileSystem(limit int, userName, marker, fsName string) ([]model.FileSystem, error)
	GetSimilarityAddressList(fsType string, ips []string) ([]model.FileSystem, error)
	// link
	CreateLink(link *model.Link) error
	FsNameLinks(fsID string) ([]model.Link, error)
	LinkWithFsIDAndFsPath(fsID, fsPath string) (model.Link, error)
	DeleteLinkWithFsID(tx *gorm.DB, id string) error
	DeleteLinkWithFsIDAndFsPath(fsID, fsPath string) error
	ListLink(limit int, marker, fsID string) ([]model.Link, error)
	GetLinkWithFsIDAndPath(fsID, fsPath string) ([]model.Link, error)
	// fs_cache_config
	CreateFSCacheConfig(fsCacheConfig *model.FSCacheConfig) error
	UpdateFSCacheConfig(fsCacheConfig *model.FSCacheConfig) error
	DeleteFSCacheConfig(tx *gorm.DB, fsID string) error
	GetFSCacheConfig(fsID string) (model.FSCacheConfig, error)
	ListFSCacheConfig(fsIDs []string) ([]model.FSCacheConfig, error)
}

type FilesystemStore

type FilesystemStore struct {
	// contains filtered or unexported fields
}

func (*FilesystemStore) CreatFileSystem

func (fss *FilesystemStore) CreatFileSystem(fs *model.FileSystem) error

func (*FilesystemStore) CreateFSCacheConfig

func (fss *FilesystemStore) CreateFSCacheConfig(fsCacheConfig *model.FSCacheConfig) error
func (fss *FilesystemStore) CreateLink(link *model.Link) error

func (*FilesystemStore) DeleteFSCacheConfig

func (fss *FilesystemStore) DeleteFSCacheConfig(tx *gorm.DB, fsID string) error

func (*FilesystemStore) DeleteFileSystem

func (fss *FilesystemStore) DeleteFileSystem(tx *gorm.DB, id string) error

func (*FilesystemStore) DeleteLinkWithFsID

func (fss *FilesystemStore) DeleteLinkWithFsID(tx *gorm.DB, fsID string) error

DeleteLinkWithFsID delete all filesystem links associated with fsID

func (*FilesystemStore) DeleteLinkWithFsIDAndFsPath

func (fss *FilesystemStore) DeleteLinkWithFsIDAndFsPath(fsID, fsPath string) error

DeleteLinkWithFsIDAndFsPath delete a file system link

func (fss *FilesystemStore) FsNameLinks(fsID string) ([]model.Link, error)

func (*FilesystemStore) GetFSCacheConfig

func (fss *FilesystemStore) GetFSCacheConfig(fsID string) (model.FSCacheConfig, error)

func (*FilesystemStore) GetFileSystemWithFsID

func (fss *FilesystemStore) GetFileSystemWithFsID(fsID string) (model.FileSystem, error)

func (*FilesystemStore) GetLinkWithFsIDAndPath

func (fss *FilesystemStore) GetLinkWithFsIDAndPath(fsID, fsPath string) ([]model.Link, error)

func (*FilesystemStore) GetSimilarityAddressList

func (fss *FilesystemStore) GetSimilarityAddressList(fsType string, ips []string) ([]model.FileSystem, error)

GetSimilarityAddressList find fs where have same type and serverAddress

func (*FilesystemStore) LinkWithFsIDAndFsPath

func (fss *FilesystemStore) LinkWithFsIDAndFsPath(fsID, fsPath string) (model.Link, error)

func (*FilesystemStore) ListFSCacheConfig added in v0.14.5

func (fss *FilesystemStore) ListFSCacheConfig(fsIDs []string) ([]model.FSCacheConfig, error)

func (*FilesystemStore) ListFileSystem

func (fss *FilesystemStore) ListFileSystem(limit int, userName, marker, fsName string) ([]model.FileSystem, error)

ListFileSystem get file systems with marker and limit sort by create_at desc

func (fss *FilesystemStore) ListLink(limit int, marker, fsID string) ([]model.Link, error)

ListLink get links with marker and limit sort by create_at desc

func (*FilesystemStore) UpdateFSCacheConfig

func (fss *FilesystemStore) UpdateFSCacheConfig(fsCacheConfig *model.FSCacheConfig) error

type FlavourStore added in v0.14.4

type FlavourStore struct {
	// contains filtered or unexported fields
}

func (*FlavourStore) CreateFlavour added in v0.14.4

func (fs *FlavourStore) CreateFlavour(flavour *model.Flavour) error

CreateFlavour create flavour

func (*FlavourStore) DeleteFlavour added in v0.14.4

func (fs *FlavourStore) DeleteFlavour(flavourName string) error

DeleteFlavour delete flavour

func (*FlavourStore) GetFlavour added in v0.14.4

func (fs *FlavourStore) GetFlavour(flavourName string) (model.Flavour, error)

GetFlavour get flavour

func (*FlavourStore) GetLastFlavour added in v0.14.4

func (fs *FlavourStore) GetLastFlavour() (model.Flavour, error)

GetLastFlavour get last flavour that usually be used for indicating last page

func (*FlavourStore) ListFlavour added in v0.14.4

func (fs *FlavourStore) ListFlavour(pk int64, maxKeys int, clusterID, queryKey string) ([]model.Flavour, error)

ListFlavour all params is nullable, and support fuzzy query of flavour's name by queryKey

func (*FlavourStore) UpdateFlavour added in v0.14.4

func (fs *FlavourStore) UpdateFlavour(flavour *model.Flavour) error

UpdateFlavour update flavour

type FlavourStoreInterface added in v0.14.4

type FlavourStoreInterface interface {
	CreateFlavour(flavour *model.Flavour) error
	DeleteFlavour(flavourName string) error
	GetFlavour(flavourName string) (model.Flavour, error)
	ListFlavour(pk int64, maxKeys int, clusterID, queryKey string) ([]model.Flavour, error)
	UpdateFlavour(flavour *model.Flavour) error
	GetLastFlavour() (model.Flavour, error)
}

type FsCacheStoreInterface

type FsCacheStoreInterface interface {
	Add(value *model.FSCache) error
	Get(fsID string, cacheID string) (*model.FSCache, error)
	Delete(fsID, cacheID string) error
	List(fsID, cacheID string) ([]model.FSCache, error)
	ListNodes(fsID []string) ([]string, error)
	Update(value *model.FSCache) (int64, error)
}

FsCacheStoreInterface currently has two implementations: DB and memory use newMemFSCache() or newDBFSCache(db *gorm.DB) to initiate

type ImageStore added in v0.14.4

type ImageStore struct {
	// contains filtered or unexported fields
}

func (*ImageStore) CreateImage added in v0.14.4

func (is *ImageStore) CreateImage(logEntry *log.Entry, image *model.Image) error

func (*ImageStore) GetImage added in v0.14.4

func (is *ImageStore) GetImage(logEntry *log.Entry, PFImageID string) (model.Image, error)

func (*ImageStore) GetUrlByPFImageID added in v0.14.4

func (is *ImageStore) GetUrlByPFImageID(logEntry *log.Entry, PFImageID string) (string, error)

func (*ImageStore) ListImageIDsByFsID added in v0.14.4

func (is *ImageStore) ListImageIDsByFsID(logEntry *log.Entry, fsID string) ([]string, error)

func (*ImageStore) UpdateImage added in v0.14.4

func (is *ImageStore) UpdateImage(logEntry *log.Entry, PFImageID string, image model.Image) error

type ImageStoreInterface added in v0.14.4

type ImageStoreInterface interface {
	CreateImage(logEntry *log.Entry, image *model.Image) error
	ListImageIDsByFsID(logEntry *log.Entry, fsID string) ([]string, error)
	GetImage(logEntry *log.Entry, PFImageID string) (model.Image, error)
	GetUrlByPFImageID(logEntry *log.Entry, PFImageID string) (string, error)
	UpdateImage(logEntry *log.Entry, PFImageID string, image model.Image) error
}

type JobStore added in v0.14.4

type JobStore struct {
	// contains filtered or unexported fields
}

func (*JobStore) CreateJob added in v0.14.4

func (js *JobStore) CreateJob(job *model.Job) error

CreateJob creates a new job

func (*JobStore) DeleteJob added in v0.14.4

func (js *JobStore) DeleteJob(jobID string) error

func (*JobStore) GetJobByID added in v0.14.4

func (js *JobStore) GetJobByID(jobID string) (model.Job, error)

func (*JobStore) GetJobStatusByID added in v0.14.4

func (js *JobStore) GetJobStatusByID(jobID string) (schema.JobStatus, error)

func (*JobStore) GetJobTaskByID added in v0.14.4

func (js *JobStore) GetJobTaskByID(id string) (model.JobTask, error)

func (*JobStore) GetJobsByRunID added in v0.14.4

func (js *JobStore) GetJobsByRunID(runID string, jobID string) ([]model.Job, error)

func (*JobStore) GetLastJob added in v0.14.4

func (js *JobStore) GetLastJob() (model.Job, error)

func (*JobStore) GetUnscopedJobByID added in v0.14.5

func (js *JobStore) GetUnscopedJobByID(jobID string) (model.Job, error)

func (*JobStore) ListByJobID added in v0.14.4

func (js *JobStore) ListByJobID(jobID string) ([]model.JobTask, error)

func (*JobStore) ListJob added in v0.14.4

func (js *JobStore) ListJob(pk int64, maxKeys int, queue, status, startTime, timestamp, userFilter string, labels map[string]string) ([]model.Job, error)

func (*JobStore) ListJobByParentID added in v0.14.4

func (js *JobStore) ListJobByParentID(parentID string) ([]model.Job, error)

func (*JobStore) ListJobByStatus added in v0.14.4

func (js *JobStore) ListJobByStatus(status schema.JobStatus) []model.Job

func (*JobStore) ListJobByUpdateTime added in v0.14.4

func (js *JobStore) ListJobByUpdateTime(updateTime string) ([]model.Job, error)

func (*JobStore) ListJobIDByLabels added in v0.14.4

func (js *JobStore) ListJobIDByLabels(labels map[string]string) ([]string, error)

list job process multi label get and result

func (*JobStore) ListJobsByQueueIDsAndStatus added in v0.14.4

func (js *JobStore) ListJobsByQueueIDsAndStatus(queueIDs []string, status schema.JobStatus) []model.Job

func (*JobStore) ListQueueInitJob added in v0.14.4

func (js *JobStore) ListQueueInitJob(queueID string) []model.Job

func (*JobStore) ListQueueJob added in v0.14.4

func (js *JobStore) ListQueueJob(queueID string, status []schema.JobStatus) []model.Job

func (*JobStore) UpdateJob added in v0.14.4

func (js *JobStore) UpdateJob(jobID string, status schema.JobStatus, runtimeInfo, runtimeStatus interface{}, message string) (schema.JobStatus, error)

func (*JobStore) UpdateJobConfig added in v0.14.4

func (js *JobStore) UpdateJobConfig(jobId string, conf *schema.Conf) error

func (*JobStore) UpdateJobStatus added in v0.14.4

func (js *JobStore) UpdateJobStatus(jobId, errMessage string, newStatus schema.JobStatus) error

func (*JobStore) UpdateTask added in v0.14.4

func (js *JobStore) UpdateTask(task *model.JobTask) error

type JobStoreInterface added in v0.14.4

type JobStoreInterface interface {
	// job
	CreateJob(job *model.Job) error
	GetJobByID(jobID string) (model.Job, error)
	GetUnscopedJobByID(jobID string) (model.Job, error)
	GetJobStatusByID(jobID string) (schema.JobStatus, error)
	DeleteJob(jobID string) error
	UpdateJobStatus(jobId, errMessage string, newStatus schema.JobStatus) error
	UpdateJobConfig(jobId string, conf *schema.Conf) error
	UpdateJob(jobID string, status schema.JobStatus, runtimeInfo, runtimeStatus interface{}, message string) (schema.JobStatus, error)
	ListQueueJob(queueID string, status []schema.JobStatus) []model.Job
	ListQueueInitJob(queueID string) []model.Job
	ListJobsByQueueIDsAndStatus(queueIDs []string, status schema.JobStatus) []model.Job
	ListJobByStatus(status schema.JobStatus) []model.Job
	GetJobsByRunID(runID string, jobID string) ([]model.Job, error)
	ListJobByUpdateTime(updateTime string) ([]model.Job, error)
	ListJobByParentID(parentID string) ([]model.Job, error)
	GetLastJob() (model.Job, error)
	ListJob(pk int64, maxKeys int, queue, status, startTime, timestamp, userFilter string, labels map[string]string) ([]model.Job, error)
	// job_lable
	ListJobIDByLabels(labels map[string]string) ([]string, error)
	// job_task
	GetJobTaskByID(id string) (model.JobTask, error)
	UpdateTask(task *model.JobTask) error
	ListByJobID(jobID string) ([]model.JobTask, error)
}

type LabelCacheInterface added in v0.14.6

type LabelCacheInterface interface {
	AddLabel(lInfo *model.LabelInfo) error
	DeleteLabel(objID, objType string) error
}

type MemFSCache

type MemFSCache struct {
	// contains filtered or unexported fields
}

func (*MemFSCache) Add

func (mem *MemFSCache) Add(value *model.FSCache) error

func (*MemFSCache) Delete

func (mem *MemFSCache) Delete(fsID, cacheID string) error

func (*MemFSCache) Get

func (mem *MemFSCache) Get(fsID string, cacheID string) (*model.FSCache, error)

func (*MemFSCache) List

func (mem *MemFSCache) List(fsID, cacheID string) ([]model.FSCache, error)

func (*MemFSCache) ListNodes

func (mem *MemFSCache) ListNodes(fsIDs []string) ([]string, error)

func (*MemFSCache) Update

func (mem *MemFSCache) Update(value *model.FSCache) (int64, error)

type NodeCacheInterface added in v0.14.6

type NodeCacheInterface interface {
	AddNode(nodeInfo *model.NodeInfo) error
	UpdateNode(nodeID string, nodeInfo *model.NodeInfo) error
	DeleteNode(nodeID string) error
	GetNode(nodeID string) (model.NodeInfo, error)
	ListNode([]string, string, int, int) ([]model.NodeInfo, error)
}

type ObjectLabelCache added in v0.14.6

type ObjectLabelCache struct {
	// contains filtered or unexported fields
}

func (*ObjectLabelCache) AddLabel added in v0.14.6

func (lc *ObjectLabelCache) AddLabel(lInfo *model.LabelInfo) error

func (*ObjectLabelCache) DeleteLabel added in v0.14.6

func (lc *ObjectLabelCache) DeleteLabel(objID, objType string) error

type PipelineStore added in v0.14.4

type PipelineStore struct {
	// contains filtered or unexported fields
}

func (*PipelineStore) CountPipelineVersion added in v0.14.4

func (ps *PipelineStore) CountPipelineVersion(pipelineID string) (int64, error)

func (*PipelineStore) CreatePipeline added in v0.14.4

func (ps *PipelineStore) CreatePipeline(logEntry *log.Entry, ppl *model.Pipeline, pplVersion *model.PipelineVersion) (pplID string, pplVersionID string, err error)

func (*PipelineStore) DeletePipeline added in v0.14.4

func (ps *PipelineStore) DeletePipeline(logEntry *log.Entry, id string) error

func (*PipelineStore) DeletePipelineVersion added in v0.14.4

func (ps *PipelineStore) DeletePipelineVersion(logEntry *log.Entry, pipelineID string, pipelineVersionID string) error

func (*PipelineStore) GetLastPipelineVersion added in v0.14.4

func (ps *PipelineStore) GetLastPipelineVersion(pipelineID string) (model.PipelineVersion, error)

func (*PipelineStore) GetPipeline added in v0.14.4

func (ps *PipelineStore) GetPipeline(name, userName string) (model.Pipeline, error)

func (*PipelineStore) GetPipelineByID added in v0.14.4

func (ps *PipelineStore) GetPipelineByID(id string) (model.Pipeline, error)

func (*PipelineStore) GetPipelineVersion added in v0.14.4

func (ps *PipelineStore) GetPipelineVersion(pipelineID string, pipelineVersionID string) (model.PipelineVersion, error)

func (*PipelineStore) GetPipelineVersions added in v0.14.4

func (ps *PipelineStore) GetPipelineVersions(pipelineID string) ([]model.PipelineVersion, error)

func (*PipelineStore) IsLastPipelinePk added in v0.14.4

func (ps *PipelineStore) IsLastPipelinePk(logEntry *log.Entry, pk int64, userFilter, nameFilter []string) (bool, error)

func (*PipelineStore) IsLastPipelineVersionPk added in v0.14.4

func (ps *PipelineStore) IsLastPipelineVersionPk(logEntry *log.Entry, pipelineID string, pk int64, fsFilter []string) (bool, error)

func (*PipelineStore) ListPipeline added in v0.14.4

func (ps *PipelineStore) ListPipeline(pk int64, maxKeys int, userFilter, nameFilter []string) ([]model.Pipeline, error)

func (*PipelineStore) ListPipelineVersion added in v0.14.4

func (ps *PipelineStore) ListPipelineVersion(pipelineID string, pk int64, maxKeys int, fsFilter []string) ([]model.PipelineVersion, error)

func (*PipelineStore) UpdatePipeline added in v0.14.4

func (ps *PipelineStore) UpdatePipeline(logEntry *log.Entry, ppl *model.Pipeline, pplVersion *model.PipelineVersion) (pplID string, pplVersionID string, err error)

type PipelineStoreInterface added in v0.14.4

type PipelineStoreInterface interface {
	// pipeline
	CreatePipeline(logEntry *log.Entry, ppl *model.Pipeline, pplVersion *model.PipelineVersion) (pplID string, pplVersionID string, err error)
	UpdatePipeline(logEntry *log.Entry, ppl *model.Pipeline, pplVersion *model.PipelineVersion) (pplID string, pplVersionID string, err error)
	GetPipelineByID(id string) (model.Pipeline, error)
	GetPipeline(name, userName string) (model.Pipeline, error)
	ListPipeline(pk int64, maxKeys int, userFilter, nameFilter []string) ([]model.Pipeline, error)
	IsLastPipelinePk(logEntry *log.Entry, pk int64, userFilter, nameFilter []string) (bool, error)
	DeletePipeline(logEntry *log.Entry, id string) error
	// pipeline_version
	ListPipelineVersion(pipelineID string, pk int64, maxKeys int, fsFilter []string) ([]model.PipelineVersion, error)
	IsLastPipelineVersionPk(logEntry *log.Entry, pipelineID string, pk int64, fsFilter []string) (bool, error)
	CountPipelineVersion(pipelineID string) (int64, error)
	GetPipelineVersions(pipelineID string) ([]model.PipelineVersion, error)
	GetPipelineVersion(pipelineID string, pipelineVersionID string) (model.PipelineVersion, error)
	GetLastPipelineVersion(pipelineID string) (model.PipelineVersion, error)
	DeletePipelineVersion(logEntry *log.Entry, pipelineID string, pipelineVersionID string) error
}

type PodCacheInterface added in v0.14.6

type PodCacheInterface interface {
	AddPod(podInfo *model.PodInfo) error
	UpdatePod(podID string, podInfo *model.PodInfo) error
	DeletePod(podID string) error
}

type PodResourceCache added in v0.14.6

type PodResourceCache struct {
	// contains filtered or unexported fields
}

func (*PodResourceCache) AddResource added in v0.14.6

func (nc *PodResourceCache) AddResource(rInfo *model.ResourceInfo) error

func (*PodResourceCache) ListNodeResources added in v0.14.6

func (nc *PodResourceCache) ListNodeResources(nodeIDList []string) ([]model.ResourceInfo, error)

func (*PodResourceCache) UpdateResource added in v0.14.6

func (nc *PodResourceCache) UpdateResource(podID string, rName string, podInfo *model.ResourceInfo) error

type QueueStore added in v0.14.4

type QueueStore struct {
	// contains filtered or unexported fields
}

func (*QueueStore) CreateOrUpdateQueue added in v0.14.4

func (qs *QueueStore) CreateOrUpdateQueue(queue *model.Queue) error

func (*QueueStore) CreateQueue added in v0.14.4

func (qs *QueueStore) CreateQueue(queue *model.Queue) error

func (*QueueStore) DeepCopyQueue added in v0.14.4

func (qs *QueueStore) DeepCopyQueue(queueSrc model.Queue, queueDesc *model.Queue)

DeepCopyQueue returns a deep copy of the queue

func (*QueueStore) DeleteQueue added in v0.14.4

func (qs *QueueStore) DeleteQueue(queueName string) error

func (*QueueStore) GetLastQueue added in v0.14.4

func (qs *QueueStore) GetLastQueue() (model.Queue, error)

func (*QueueStore) GetQueueByID added in v0.14.4

func (qs *QueueStore) GetQueueByID(queueID string) (model.Queue, error)

func (*QueueStore) GetQueueByName added in v0.14.4

func (qs *QueueStore) GetQueueByName(queueName string) (model.Queue, error)

func (*QueueStore) IsQueueExist added in v0.14.4

func (qs *QueueStore) IsQueueExist(queueName string) bool

func (*QueueStore) IsQueueInUse added in v0.14.4

func (qs *QueueStore) IsQueueInUse(queueID string) (bool, map[string]schema.JobStatus)

func (*QueueStore) ListQueue added in v0.14.4

func (qs *QueueStore) ListQueue(pk int64, maxKeys int, queueName string, userName string) ([]model.Queue, error)

func (*QueueStore) ListQueuesByCluster added in v0.14.4

func (qs *QueueStore) ListQueuesByCluster(clusterID string) []model.Queue

func (*QueueStore) UpdateQueue added in v0.14.4

func (qs *QueueStore) UpdateQueue(queue *model.Queue) error

func (*QueueStore) UpdateQueueInfo added in v0.14.4

func (qs *QueueStore) UpdateQueueInfo(name, status string, max, min *resources.Resource) error

func (*QueueStore) UpdateQueueStatus added in v0.14.4

func (qs *QueueStore) UpdateQueueStatus(queueName string, queueStatus string) error

type QueueStoreInterface added in v0.14.4

type QueueStoreInterface interface {
	CreateQueue(queue *model.Queue) error
	CreateOrUpdateQueue(queue *model.Queue) error
	UpdateQueue(queue *model.Queue) error
	UpdateQueueStatus(queueName string, queueStatus string) error
	UpdateQueueInfo(name, status string, max, min *resources.Resource) error
	DeleteQueue(queueName string) error
	IsQueueExist(queueName string) bool
	GetQueueByName(queueName string) (model.Queue, error)
	GetQueueByID(queueID string) (model.Queue, error)
	ListQueue(pk int64, maxKeys int, queueName string, userName string) ([]model.Queue, error)
	GetLastQueue() (model.Queue, error)
	ListQueuesByCluster(clusterID string) []model.Queue
	IsQueueInUse(queueID string) (bool, map[string]schema.JobStatus)
	DeepCopyQueue(queueSrc model.Queue, queueDesc *model.Queue)
}

type ResourceCacheInterface added in v0.14.6

type ResourceCacheInterface interface {
	AddResource(rInfo *model.ResourceInfo) error
	UpdateResource(podID string, rName string, rInfo *model.ResourceInfo) error
	ListNodeResources([]string) ([]model.ResourceInfo, error)
}

type RunArtifactStore added in v0.14.4

type RunArtifactStore struct {
	// contains filtered or unexported fields
}

func (*RunArtifactStore) CountArtifactEvent added in v0.14.4

func (rs *RunArtifactStore) CountArtifactEvent(logEntry *log.Entry, fsID, artifactPath string) (int64, error)

func (*RunArtifactStore) CreateArtifactEvent added in v0.14.4

func (rs *RunArtifactStore) CreateArtifactEvent(logEntry *log.Entry, artifact model.ArtifactEvent) error

func (*RunArtifactStore) DeleteArtifactEvent added in v0.14.4

func (rs *RunArtifactStore) DeleteArtifactEvent(logEntry *log.Entry, username, fsname, runID, artifactPath string) error

func (*RunArtifactStore) GetArtifactEvent added in v0.14.4

func (rs *RunArtifactStore) GetArtifactEvent(logEntry *log.Entry, runID, fsID, artifactPath string) (model.ArtifactEvent, error)

func (*RunArtifactStore) GetLastArtifactEvent added in v0.14.4

func (rs *RunArtifactStore) GetLastArtifactEvent(logEntry *log.Entry) (model.ArtifactEvent, error)

func (*RunArtifactStore) ListArtifactEvent added in v0.14.4

func (rs *RunArtifactStore) ListArtifactEvent(logEntry *log.Entry, pk int64, maxKeys int, userFilter, fsFilter, runFilter, typeFilter, pathFilter []string) ([]model.ArtifactEvent, error)

func (*RunArtifactStore) UpdateArtifactEvent added in v0.14.4

func (rs *RunArtifactStore) UpdateArtifactEvent(logEntry *log.Entry, fsID, artifactPath string, artifact model.ArtifactEvent) error

type Transaction added in v0.14.4

type Transaction func(db *gorm.DB) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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