Documentation
¶
Index ¶
- Constants
- func ConvertData(value interface{}, fieldType string) (interface{}, error)
- type Model
- func (m Model) ByID(contID container.ID, objectID string) (map[string]interface{}, string, int, error)
- func (m Model) Create(contID container.ID, inputData map[string]interface{}) (string, string, int, error)
- func (m Model) Get(contID container.ID) ([]map[string]interface{}, string, int, error)
- func (m Model) Update(contID container.ID, objID string, inputData map[string]interface{}) (string, int, error)
Constants ¶
View Source
const ( CreationError = "could not create object" CreationSuccess = "created successfully" SUCCESS = "success" RetrieveError = "Could not retrieve the objects" ObjectNotFound = "Object Not found" InvalidDataType = "Invalid data type" UnknownFieldNameInData = "Unknown field name" UpdateError = "Error during field update" UpdateSuccess = "Field updated successfully" )
MESSAGES
View Source
const ( MongoObjectCollection = "Objects" MongoObjectIDColumn = "_id" MongoObjectContainerIDColumn = "container_id" MongoObjectCreatedAtColumn = "created_at" MongoObjectUpdatedAtColumn = "updated_at" )
Monngo DB const
Variables ¶
This section is empty.
Functions ¶
func ConvertData ¶
ConvertData will check data type of the value
Types ¶
type Model ¶
Model #
func (Model) ByID ¶
func (m Model) ByID( contID container.ID, objectID string, ) (map[string]interface{}, string, int, error)
ByID Get the object of the container by its ID
func (Model) Create ¶
func (m Model) Create( contID container.ID, inputData map[string]interface{}, ) (string, string, int, error)
Create new Object
Click to show internal directories.
Click to hide internal directories.