app

package
v0.0.0-...-b0339d0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB_NAME        = "DeploymentManagerDB"
	APP_COLLECTION = "APP"
	SERVICES_FIELD = "services"
	IMAGE_FIELD    = "image"
	DB_URL         = "127.0.0.1:27017"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	ID       string   `bson:"_id,omitempty"`
	Images   []string `bson:"images"`
	Services []string `bson:"services"`
	RefCnt   int      `bson:"refcnt"`
}

type Command

type Command interface {
	// AddApp insert a deployed application information.
	AddApp(appId string, description []byte) error

	// GetApp returns single document from db related to app.
	GetApp(appId string) (map[string]interface{}, error)

	// GetApps returns all matches for the query-string which is passed in call to function.
	GetApps(queryOptional ...map[string]interface{}) ([]map[string]interface{}, error)

	// DeleteApp delete a deployed application information.
	DeleteApp(appId string) error
}

Interface of App model's operations.

type Executor

type Executor struct {
}

func (Executor) AddApp

func (Executor) AddApp(appId string, description []byte) error

AddApp insert a deployed application information. if succeed to add, return app information as map. otherwise, return error.

func (Executor) DeleteApp

func (Executor) DeleteApp(appId string) error

DeleteApp delete a deployed application information. if succeed to delete, return error as nil. otherwise, return error.

func (Executor) GetApp

func (Executor) GetApp(appId string) (map[string]interface{}, error)

GetApp returns single document specified by appId parameter. If successful, this function returns an error as nil. otherwise, an appropriate error will be returned.

func (Executor) GetApps

func (Executor) GetApps(queryOptional ...map[string]interface{}) ([]map[string]interface{}, error)

GetApps returns all matches for the query-string which is passed in call to function. if succeed to get, return list of all app information as slice. otherwise, return error.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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