store

package
v0.0.0-...-964918b Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceCollectionName string = "ResourceCollection"
)

Variables

This section is empty.

Functions

func Init

func Init(s *mgo.Session)

Init store mongo client session

Types

type DataStore

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

DataStore is the type for mongo db store.

func NewStore

func NewStore() *DataStore

NewStore copy a mongo client session

func (*DataStore) AddNewFailVersion

func (d *DataStore) AddNewFailVersion(serviceID string, versionID string) error

AddNewFailVersion adds a new fail version (version ID) to a given service.

func (*DataStore) AddNewVersion

func (d *DataStore) AddNewVersion(serviceID string, versionID string) error

AddNewVersion adds a new success version (version ID) to a given service.

func (*DataStore) Close

func (d *DataStore) Close()

Close close mongo client session

func (*DataStore) DeleteServiceByID

func (d *DataStore) DeleteServiceByID(serviceID string) error

DeleteServiceByID removes service by service_id.

func (*DataStore) DeleteVersionByID

func (d *DataStore) DeleteVersionByID(versionID string) error

DeleteVersionByID removes version by versionID.

func (*DataStore) DeleteWorkerNodeByID

func (d *DataStore) DeleteWorkerNodeByID(nodeID string) error

DeleteWorkerNodeByID removes worker node by node_id.

func (*DataStore) FindDeployByID

func (d *DataStore) FindDeployByID(deployID string) (*api.Deploy, error)

FindDeployByID finds a deploy entity by ID.

func (*DataStore) FindResourceByID

func (d *DataStore) FindResourceByID(userID string) (*api.Resource, error)

FindResourceByID finds a resource entity by userID.

func (*DataStore) FindServiceByCondition

func (d *DataStore) FindServiceByCondition(userID, servicename string) ([]api.Service, error)

FindServiceByCondition finds a list of services via user ID and serice name.

func (*DataStore) FindServiceByID

func (d *DataStore) FindServiceByID(serviceID string) (*api.Service, error)

FindServiceByID finds a service entity by ID.

func (*DataStore) FindServicesByUserID

func (d *DataStore) FindServicesByUserID(userID string) ([]api.Service, error)

FindServicesByUserID finds a list of services via user ID.

func (*DataStore) FindSystemWorkerNode

func (d *DataStore) FindSystemWorkerNode() ([]api.WorkerNode, error)

FindSystemWorkerNode finds a list of system worker node.

func (*DataStore) FindSystemWorkerNodeByResource

func (d *DataStore) FindSystemWorkerNodeByResource(resource *api.BuildResource) ([]api.WorkerNode, error)

FindSystemWorkerNodeByResource finds a list of system worker node by resouce.

func (*DataStore) FindVersionByID

func (d *DataStore) FindVersionByID(versionID string) (*api.Version, error)

FindVersionByID finds a version entity by ID.

func (*DataStore) FindVersionLogByID

func (d *DataStore) FindVersionLogByID(LogID string) (*api.VersionLog, error)

FindVersionLogByID finds a version log entity by ID.

func (*DataStore) FindVersionLogByVersionID

func (d *DataStore) FindVersionLogByVersionID(versionID string) (*api.VersionLog, error)

FindVersionLogByVersionID finds a version log entity by version ID.

func (*DataStore) FindVersionsByCondition

func (d *DataStore) FindVersionsByCondition(serviceID, versionname string) ([]api.Version, error)

FindVersionsByCondition finds a version entity by service ID and version name.

func (*DataStore) FindVersionsByServiceID

func (d *DataStore) FindVersionsByServiceID(serviceID string) ([]api.Version, error)

FindVersionsByServiceID finds a version entity by service ID.

func (*DataStore) FindWorkerNodeByID

func (d *DataStore) FindWorkerNodeByID(nodeID string) (*api.WorkerNode, error)

FindWorkerNodeByID finds a worker node entity by ID.

func (*DataStore) FindWorkerNodesByDockerHost

func (d *DataStore) FindWorkerNodesByDockerHost(dockerHost string) ([]api.WorkerNode, error)

FindWorkerNodesByDockerHost finds a list of WorkerNodes via docker host.

func (*DataStore) FindtokenByUserID

func (d *DataStore) FindtokenByUserID(userID, urlvsc string) (*api.VscToken, error)

FindtokenByUserID finds token by UserID.

func (*DataStore) NewDeployDocument

func (d *DataStore) NewDeployDocument(deploy *api.Deploy) (string, error)

NewDeployDocument creates a new document (record) in mongodb. It returns deploy id of the newly created deploy.

func (*DataStore) NewResourceDocument

func (d *DataStore) NewResourceDocument(resource *api.Resource) error

NewResourceDocument creates a new document (record) in mongodb.

func (*DataStore) NewServiceDocument

func (d *DataStore) NewServiceDocument(service *api.Service) (string, error)

NewServiceDocument creates a new document (record) in mongodb. It returns service id of the newly created service.

func (*DataStore) NewSystemWorkerNodeDocument

func (d *DataStore) NewSystemWorkerNodeDocument(workerNode *api.WorkerNode) (string, error)

NewSystemWorkerNodeDocument creates a new document (record) in mongodb. It returns worker node id of the newly created worker node.

func (*DataStore) NewTokenDocument

func (d *DataStore) NewTokenDocument(token *api.VscToken) error

NewTokenDocument creates a new document (record) in mongodb.

func (*DataStore) NewVersionDocument

func (d *DataStore) NewVersionDocument(version *api.Version) (string, error)

NewVersionDocument creates a new document (record) in mongodb. It returns version id of the newly created version.

func (*DataStore) NewVersionLogDocument

func (d *DataStore) NewVersionLogDocument(versionLog *api.VersionLog) (string, error)

NewVersionLogDocument creates a new document (record) in mongodb. It returns version log id of the newly created version.

func (*DataStore) Ping

func (d *DataStore) Ping() error

Ping ping mongo server

func (*DataStore) RemoveTokeninDB

func (d *DataStore) RemoveTokeninDB(userID string, urlvsc string) error

RemoveTokeninDB removes token.

func (*DataStore) UpdateRepositoryStatus

func (d *DataStore) UpdateRepositoryStatus(serviceID string, status api.RepositoryStatus) error

UpdateRepositoryStatus updates service repository status.

func (*DataStore) UpdateResourceDocument

func (d *DataStore) UpdateResourceDocument(resource *api.Resource) error

UpdateResourceDocument update a document (record) in mongodb.

func (*DataStore) UpdateResourceStatus

func (d *DataStore) UpdateResourceStatus(userID string, memory float64, cpu float64) error

UpdateResourceStatus updates resource's memory and cpu.

func (*DataStore) UpdateServiceLastInfo

func (d *DataStore) UpdateServiceLastInfo(serviceID string, lasttime time.Time, lastname string) error

UpdateServiceLastInfo updates service's lastCreateTIme and lastVersionName.

func (*DataStore) UpdateToken

func (d *DataStore) UpdateToken(token *api.VscToken) error

UpdateToken update token via user ID.

func (*DataStore) UpdateVersionDocument

func (d *DataStore) UpdateVersionDocument(versionID string, version api.Version) error

UpdateVersionDocument updates a version entirely.

func (*DataStore) UpdateVersionLogDocument

func (d *DataStore) UpdateVersionLogDocument(versionLog *api.VersionLog) error

UpdateVersionLogDocument updates a document (record) in mongodb.

func (*DataStore) UpsertDeployDocument

func (d *DataStore) UpsertDeployDocument(deploy *api.Deploy) (string, error)

UpsertDeployDocument upsert a special deploy document

func (*DataStore) UpsertServiceDocument

func (d *DataStore) UpsertServiceDocument(service *api.Service) (string, error)

UpsertServiceDocument upsert a special serivce document

func (*DataStore) UpsertWorkerNodeDocument

func (d *DataStore) UpsertWorkerNodeDocument(node *api.WorkerNode) (string, error)

UpsertWorkerNodeDocument upsert a special woker node document

Jump to

Keyboard shortcuts

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