Example #1
0
//Temporary hack to create an assembly from its id.
//This is used by SetStatus.
//We need add a Notifier interface duck typed by Box and Carton ?
func NewBalances(id string) (*Balances, error) {
	b := &Balances{}
	if err := db.Fetch(BALANCESBUCKET, id, b); err != nil {
		return nil, err
	}
	return b, nil
}
Example #2
0
func getBig(id string) (*Ambly, error) {
	a := &Ambly{}
	if err := db.Fetch(ASSEMBLYBUCKET, id, a); err != nil {
		return nil, err
	}
	return a, nil
}
Example #3
0
//get the assembly and its children (component). we only store the
//componentid, hence you see that we have a components map to cater to that need.
func get(id string) (*Assembly, error) {
	a := &Assembly{Components: make(map[string]*Component)}
	if err := db.Fetch(ASSEMBLYBUCKET, id, a); err != nil {
		return nil, err
	}
	a.dig()
	return a, nil
}
Example #4
0
/** A public function which pulls the assemblies for deployment.
and any others we do. **/
func Get(id string) (*Assemblies, error) {
	a := &Assemblies{}
	if err := db.Fetch("assemblies", id, a); err != nil {
		return nil, err
	}

	log.Debugf("Assemblies %v", a)
	return a, nil
}
Example #5
0
//The payload in the queue can be just a pointer or a value.
//pointer means just the id will be available and rest is blank.
//value means the id is blank and others are available.
func listReqsById(id string) (*Requests, error) {
	log.Debugf("list requests %s", id)
	r := &Requests{}
	if err := db.Fetch("requests", id, r); err != nil {
		return nil, err
	}

	log.Debugf("Requests %v", r)
	return r, nil
}