see

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitModels

func InitModels()

InitModels initialize models in mongo, if required.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is used to store users

func NewManager

func NewManager(r *http.Request) *Manager

NewManager creates and initializes a new Manager

func (*Manager) AddVersion

func (m *Manager) AddVersion(username string, globalID string, uniqueID string, seeVersion *SeeVersion) error

AddVersion adds a new version to the object

func (*Manager) Create

func (m *Manager) Create(see *See) error

Create an object

func (*Manager) GetSeeObject

func (m *Manager) GetSeeObject(username string, globalID string, uniqueID string) (seeObject *See, err error)

GetSeeObject returns a see object

func (*Manager) GetSeeObjects

func (m *Manager) GetSeeObjects(username string) (seeObjects []See, err error)

GetSeeObjects returns all see object for a specific username

func (*Manager) GetSeeObjectsByOrganization

func (m *Manager) GetSeeObjectsByOrganization(username string, globalID string) (seeObjects []See, err error)

GetSeeObjectsByOrganization returns all see object for a specific username / organization

func (*Manager) Update

func (m *Manager) Update(see *See) error

Update adds a signature to an existing version

type See

type See struct {
	ID       bson.ObjectId `json:"-" bson:"_id,omitempty"`
	Username string        `json:"username"`
	Globalid string        `json:"globalid"`
	Uniqueid string        `json:"uniqueid" validate:"max=100,nonzero"`
	Versions []SeeVersion  `json:"versions"`
}

func (*See) ConvertToSeeView

func (s *See) ConvertToSeeView(version int) *SeeView

type SeeVersion

type SeeVersion struct {
	Version                  int          `json:"version" bson:"-"`
	Category                 string       `json:"category" validate:"max=100,nonzero"`
	Link                     string       `json:"link" validate:"nonzero"`
	ContentType              string       `json:"content_type"`
	MarkdownShortDescription string       `json:"markdown_short_description" validate:"max=500,nonzero"`
	MarkdownFullDescription  string       `json:"markdown_full_description" validate:"nonzero"`
	CreationDate             *db.DateTime `json:"creation_date"`
	StartDate                *db.DateTime `json:"start_date,omitempty" bson:"startdate,omitempty"`
	EndDate                  *db.DateTime `json:"end_date,omitempty" bson:"enddate,omitempty"`
	KeyStoreLabel            string       `json:"keystore_label"`
	Signature                string       `json:"signature"`
}

type SeeView

type SeeView struct {
	SeeVersion
	Username string `json:"username"`
	Globalid string `json:"globalid"`
	Uniqueid string `json:"uniqueid" validate:"max=100,nonzero"`
}

func (*SeeView) ConvertToSeeVersion

func (s *SeeView) ConvertToSeeVersion() *SeeVersion

Jump to

Keyboard shortcuts

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