example

package
Version: v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB_NAME           = "test"
	SHORT_DATE_LAYOUT = "2000-Jan-01"
	USERS_C           = "users"
	ORGANIZATIONS_C   = "organizations"
)

Variables

Functions

This section is empty.

Types

type Organization

type Organization struct {
	Id          bson.ObjectId `bson:"_id,omitempty"`
	Name        string        `bson:"name"`
	Location    string        `bson:"location"`
	DateFounded time.Time     `bson:"date_founded"`
}

type Organization_v2

type Organization_v2 struct {
	Id           bson.ObjectId `bson:"_id,omitempty"`
	Name         string        `bson:"name"`
	Headquarters string        `bson:"headquarters"`
	DateFounded  time.Time     `bson:"date_founded"`
}

type SampleMongoDbMigrator

type SampleMongoDbMigrator struct {
}

func (*SampleMongoDbMigrator) DbName

func (r *SampleMongoDbMigrator) DbName() string

func (*SampleMongoDbMigrator) V001_init_organizations_down

func (r *SampleMongoDbMigrator) V001_init_organizations_down(session *mgo.Session) error

func (*SampleMongoDbMigrator) V001_init_organizations_up

func (r *SampleMongoDbMigrator) V001_init_organizations_up(session *mgo.Session) error

func (*SampleMongoDbMigrator) V001_init_users_down

func (r *SampleMongoDbMigrator) V001_init_users_down(session *mgo.Session) error

func (*SampleMongoDbMigrator) V001_init_users_up

func (r *SampleMongoDbMigrator) V001_init_users_up(session *mgo.Session) error

func (*SampleMongoDbMigrator) V001_method_with_wrong_signature_down

func (r *SampleMongoDbMigrator) V001_method_with_wrong_signature_down(session *mgo.Session) (bool, error)

func (*SampleMongoDbMigrator) V001_method_with_wrong_signature_up

func (r *SampleMongoDbMigrator) V001_method_with_wrong_signature_up(s string) error

func (*SampleMongoDbMigrator) V002_change_user_cleo_to_cleopatra_down

func (r *SampleMongoDbMigrator) V002_change_user_cleo_to_cleopatra_down(session *mgo.Session) error

func (*SampleMongoDbMigrator) V002_change_user_cleo_to_cleopatra_up

func (r *SampleMongoDbMigrator) V002_change_user_cleo_to_cleopatra_up(session *mgo.Session) error

func (*SampleMongoDbMigrator) V002_organizations_rename_location_field_to_headquarters_down

func (r *SampleMongoDbMigrator) V002_organizations_rename_location_field_to_headquarters_down(session *mgo.Session) error

func (*SampleMongoDbMigrator) V002_organizations_rename_location_field_to_headquarters_up

func (r *SampleMongoDbMigrator) V002_organizations_rename_location_field_to_headquarters_up(session *mgo.Session) error

type User

type User struct {
	Id   bson.ObjectId `bson:"_id"`
	Name string        `bson:"name"`
}

Jump to

Keyboard shortcuts

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