21 lines
408 B
Go
Raw Normal View History

2019-06-03 09:32:43 +00:00
package arn
// IDList stores lists of IDs that are retrievable by name.
2019-11-18 06:13:51 +00:00
type IDList []ID
2019-06-03 09:32:43 +00:00
// GetIDList ...
2019-11-18 06:13:51 +00:00
func GetIDList(id ID) (IDList, error) {
2019-06-03 09:32:43 +00:00
obj, err := DB.Get("IDList", id)
if err != nil {
return nil, err
}
return *obj.(*IDList), nil
}
// Append appends the given ID to the end of the list and returns the new IDList.
2019-11-18 06:13:51 +00:00
func (idList IDList) Append(id ID) IDList {
2019-06-03 09:32:43 +00:00
return append(idList, id)
}