models

package
v0.0.0-...-dfb77c5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2017 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

* Copyright 2014-2015 LDLN * * This file is part of LDLN Base Station. * * LDLN Base Station is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * LDLN Base Station is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LDLN Base Station. If not, see <http://www.gnu.org/licenses/>.

* Copyright 2014-2015 LDLN * * This file is part of LDLN Base Station. * * LDLN Base Station is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * LDLN Base Station is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LDLN Base Station. If not, see <http://www.gnu.org/licenses/>.

* Copyright 2014-2015 LDLN * * This file is part of LDLN Base Station. * * LDLN Base Station is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * LDLN Base Station is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LDLN Base Station. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collection

func Collection(m interface{}, s *mgo.Session) *mgo.Collection

func DecodeBase64

func DecodeBase64(s string) []byte

func Decrypt

func Decrypt(key, text []byte) []byte

func EncodeBase64

func EncodeBase64(b []byte) string

func Encrypt

func Encrypt(key, text []byte) []byte

Types

type Model

type Model struct {
	Id bson.ObjectId `bson:"_id,omitempty"`
}

type Schema

type Schema struct {
	ObjectKey   string        `json:"object_key" bson:"object_key"`
	ObjectLabel string        `json:"object_label" bson:"object_label"`
	Weight      int           `json:"weight" bson:"weight"`
	Schema      []SchemaField `json:"schema" bson:"schema"`
}

type SchemaField

type SchemaField struct {
	Key      string `json:"key" bson:"key"`
	Label    string `json:"label" bson:"label"`
	Type     string `json:"type" bson:"type"`
	Weight   int    `json:"weight" bson:"weight"`
	Required bool   `json:"required" bson:"required"`
	Default  string `json:"default" bson:"default"`
}

type SyncableObject

type SyncableObject struct {
	Model                     `bson:",inline"`
	Uuid                      string `json:"uuid" bson:"uuid"`
	ObjectType                string `json:"object_type" bson:"object_type"`
	KeyValuePairs             string `json:"key_value_pairs" bson:"key_value_pairs"`
	TimeModifiedSinceCreation int    `json:"time_modified_since_creation" bson:"time_modified_since_creation"`
}

func GetAllSyncableObjects

func GetAllSyncableObjects(s *mgo.Session) []SyncableObject

Jump to

Keyboard shortcuts

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