repository

package
v0.0.0-...-6690423 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidAppointmentAssertionError = errors.New("invalid appointment type")
)

Functions

This section is empty.

Types

type AppointmentRepository

type AppointmentRepository struct {
	Repository
	// contains filtered or unexported fields
}

func NewAppointmentRepository

func NewAppointmentRepository(db *gorm.DB) *AppointmentRepository

func (*AppointmentRepository) Create

func (r *AppointmentRepository) Create(calID uint, m Model) error

func (*AppointmentRepository) DeleteItem

func (r *AppointmentRepository) DeleteItem(calID, uid uint) error

func (*AppointmentRepository) DeleteRecurrence

func (r *AppointmentRepository) DeleteRecurrence(itemID uint, date time.Time) error

func (*AppointmentRepository) FindBetweenDates

func (r *AppointmentRepository) FindBetweenDates(calID uint, start, finish time.Time) ([]Model, error)

func (*AppointmentRepository) FindByID

func (r *AppointmentRepository) FindByID(calID, uid uint) (model.Appointment, error)

func (*AppointmentRepository) Model

func (r *AppointmentRepository) Model() Model

func (*AppointmentRepository) Update

func (r *AppointmentRepository) Update(calID, itemID uint, new Model) error

type CalendarRepository

type CalendarRepository interface {
	FindByID(uid uint) (*model.Calendar, error)
	FindOrCreateForDeletedID(uid uint) (*model.Calendar, error)
	AllCalendars() ([]model.Calendar, error)
}

func NewCalendarRepository

func NewCalendarRepository(db *gorm.DB) CalendarRepository

type ItemRepository

type ItemRepository interface {
	// Create an item
	Create(calID uint, m Model) error

	// Model gives a new instance of the model that is used in the repository
	// e.g. Note or Appointment
	Model() Model

	// Find Items between two given dates.
	FindBetweenDates(calID uint, start, finish time.Time) ([]Model, error)

	// Delete an entire Item, recurrences and all
	DeleteItem(calID uint, id uint) error

	// Delete a single recurrence from an item (create a DeletedDate)
	DeleteRecurrence(itemID uint, date time.Time) error

	// Update an item given by its ID by the values in "new"
	Update(calID uint, itemID uint, new Model) error
}

type Model

type Model interface {
	GetID() uint
	Name() string
}

type NoteRepository

type NoteRepository struct {
	Repository
}

func NewNoteRepository

func NewNoteRepository(db *gorm.DB) *NoteRepository

func (*NoteRepository) Create

func (r *NoteRepository) Create(calID uint, m Model) error

func (*NoteRepository) DeleteItem

func (r *NoteRepository) DeleteItem(calID, uid uint) error

func (*NoteRepository) DeleteRecurrence

func (r *NoteRepository) DeleteRecurrence(itemID uint, date time.Time) error

func (*NoteRepository) FindBetweenDates

func (r *NoteRepository) FindBetweenDates(calID uint, start, finish time.Time) ([]Model, error)

func (*NoteRepository) FindByID

func (r *NoteRepository) FindByID(calID, uid uint) (model.Note, error)

func (*NoteRepository) Model

func (r *NoteRepository) Model() Model

func (*NoteRepository) Update

func (r *NoteRepository) Update(calID, itemID uint, new Model) error

type OptionsRepository

type OptionsRepository interface {
	FindByCalendarID(uid uint, create bool) (*model.CalendarOptions, error)
	Update(calID uint, new *model.CalendarOptions) error
}

func NewOptionsRepository

func NewOptionsRepository(db *gorm.DB) OptionsRepository

type Repository

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

Jump to

Keyboard shortcuts

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