Documentation ¶
Index ¶
- Constants
- func Init(s *mgo.Session)
- type DataStore
- func (d *DataStore) AddNewFailVersion(serviceID string, versionID string) error
- func (d *DataStore) AddNewVersion(serviceID string, versionID string) error
- func (d *DataStore) Close()
- func (d *DataStore) DeleteServiceByID(serviceID string) error
- func (d *DataStore) DeleteVersionByID(versionID string) error
- func (d *DataStore) DeleteWorkerNodeByID(nodeID string) error
- func (d *DataStore) FindDeployByID(deployID string) (*api.Deploy, error)
- func (d *DataStore) FindResourceByID(userID string) (*api.Resource, error)
- func (d *DataStore) FindServiceByCondition(userID, servicename string) ([]api.Service, error)
- func (d *DataStore) FindServiceByID(serviceID string) (*api.Service, error)
- func (d *DataStore) FindServicesByUserID(userID string) ([]api.Service, error)
- func (d *DataStore) FindSystemWorkerNode() ([]api.WorkerNode, error)
- func (d *DataStore) FindSystemWorkerNodeByResource(resource *api.BuildResource) ([]api.WorkerNode, error)
- func (d *DataStore) FindVersionByID(versionID string) (*api.Version, error)
- func (d *DataStore) FindVersionLogByID(LogID string) (*api.VersionLog, error)
- func (d *DataStore) FindVersionLogByVersionID(versionID string) (*api.VersionLog, error)
- func (d *DataStore) FindVersionsByCondition(serviceID, versionname string) ([]api.Version, error)
- func (d *DataStore) FindVersionsByServiceID(serviceID string) ([]api.Version, error)
- func (d *DataStore) FindWorkerNodeByID(nodeID string) (*api.WorkerNode, error)
- func (d *DataStore) FindWorkerNodesByDockerHost(dockerHost string) ([]api.WorkerNode, error)
- func (d *DataStore) FindtokenByUserID(userID, urlvsc string) (*api.VscToken, error)
- func (d *DataStore) NewDeployDocument(deploy *api.Deploy) (string, error)
- func (d *DataStore) NewResourceDocument(resource *api.Resource) error
- func (d *DataStore) NewServiceDocument(service *api.Service) (string, error)
- func (d *DataStore) NewSystemWorkerNodeDocument(workerNode *api.WorkerNode) (string, error)
- func (d *DataStore) NewTokenDocument(token *api.VscToken) error
- func (d *DataStore) NewVersionDocument(version *api.Version) (string, error)
- func (d *DataStore) NewVersionLogDocument(versionLog *api.VersionLog) (string, error)
- func (d *DataStore) Ping() error
- func (d *DataStore) RemoveTokeninDB(userID string, urlvsc string) error
- func (d *DataStore) UpdateRepositoryStatus(serviceID string, status api.RepositoryStatus) error
- func (d *DataStore) UpdateResourceDocument(resource *api.Resource) error
- func (d *DataStore) UpdateResourceStatus(userID string, memory float64, cpu float64) error
- func (d *DataStore) UpdateServiceLastInfo(serviceID string, lasttime time.Time, lastname string) error
- func (d *DataStore) UpdateToken(token *api.VscToken) error
- func (d *DataStore) UpdateVersionDocument(versionID string, version api.Version) error
- func (d *DataStore) UpdateVersionLogDocument(versionLog *api.VersionLog) error
- func (d *DataStore) UpsertDeployDocument(deploy *api.Deploy) (string, error)
- func (d *DataStore) UpsertServiceDocument(service *api.Service) (string, error)
- func (d *DataStore) UpsertWorkerNodeDocument(node *api.WorkerNode) (string, error)
Constants ¶
const (
ResourceCollectionName string = "ResourceCollection"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataStore ¶
type DataStore struct {
// contains filtered or unexported fields
}
DataStore is the type for mongo db store.
func (*DataStore) AddNewFailVersion ¶
AddNewFailVersion adds a new fail version (version ID) to a given service.
func (*DataStore) AddNewVersion ¶
AddNewVersion adds a new success version (version ID) to a given service.
func (*DataStore) DeleteServiceByID ¶
DeleteServiceByID removes service by service_id.
func (*DataStore) DeleteVersionByID ¶
DeleteVersionByID removes version by versionID.
func (*DataStore) DeleteWorkerNodeByID ¶
DeleteWorkerNodeByID removes worker node by node_id.
func (*DataStore) FindDeployByID ¶
FindDeployByID finds a deploy entity by ID.
func (*DataStore) FindResourceByID ¶
FindResourceByID finds a resource entity by userID.
func (*DataStore) FindServiceByCondition ¶
FindServiceByCondition finds a list of services via user ID and serice name.
func (*DataStore) FindServiceByID ¶
FindServiceByID finds a service entity by ID.
func (*DataStore) FindServicesByUserID ¶
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 ¶
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 ¶
FindVersionsByCondition finds a version entity by service ID and version name.
func (*DataStore) FindVersionsByServiceID ¶
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 ¶
FindtokenByUserID finds token by UserID.
func (*DataStore) NewDeployDocument ¶
NewDeployDocument creates a new document (record) in mongodb. It returns deploy id of the newly created deploy.
func (*DataStore) NewResourceDocument ¶
NewResourceDocument creates a new document (record) in mongodb.
func (*DataStore) NewServiceDocument ¶
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 ¶
NewTokenDocument creates a new document (record) in mongodb.
func (*DataStore) NewVersionDocument ¶
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) RemoveTokeninDB ¶
RemoveTokeninDB removes token.
func (*DataStore) UpdateRepositoryStatus ¶
func (d *DataStore) UpdateRepositoryStatus(serviceID string, status api.RepositoryStatus) error
UpdateRepositoryStatus updates service repository status.
func (*DataStore) UpdateResourceDocument ¶
UpdateResourceDocument update a document (record) in mongodb.
func (*DataStore) UpdateResourceStatus ¶
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 ¶
UpdateToken update token via user ID.
func (*DataStore) UpdateVersionDocument ¶
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 ¶
UpsertDeployDocument upsert a special deploy document
func (*DataStore) UpsertServiceDocument ¶
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