bolt

package
v0.0.0-...-4b60dc3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Filename to the BoltDB database.
	Path string

	// Validator
	Validator envy.Validator

	// Returns the current time.
	Now func() time.Time
	// contains filtered or unexported fields
}

Client represents a client to the underlying BoltDB data store.

func NewClient

func NewClient() *Client

func (*Client) Close

func (c *Client) Close() error

Close closes then underlying BoltDB database.

func (*Client) Connect

func (c *Client) Connect() *Session

Connect returns a new session to the BoltDB database.

func (*Client) Open

func (c *Client) Open() error

Open opens and initializes the BoltDB database.

type CourseStorage

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

func (*CourseStorage) AddCourse

func (c *CourseStorage) AddCourse(d *envy.Course) error

func (*CourseStorage) Course

func (c *CourseStorage) Course(id int) (*envy.Course, error)

func (*CourseStorage) Encode

func (c *CourseStorage) Encode(id int) (string, error)

func (*CourseStorage) RemoveCourse

func (c *CourseStorage) RemoveCourse(*envy.Course) error

func (*CourseStorage) Validate

func (c *CourseStorage) Validate(token string) (*envy.Course, error)

type Session

type Session struct {
	Validator envy.Validator
	// contains filtered or unexported fields
}

Session represents an authenticable connection to the database.

func (*Session) CourseStorage

func (s *Session) CourseStorage() envy.CourseStorage

CourseStorage returns the service associated with this session

func (*Session) Encode

func (s *Session) Encode(i int) (string, error)

Validate checks the course token

func (*Session) SetCourseToken

func (s *Session) SetCourseToken(token string)

func (*Session) StudentStorage

func (s *Session) StudentStorage() envy.StudentStorage

StudentStorage returns the service associated with this session

func (*Session) Validate

func (s *Session) Validate() (*envy.Course, error)

Validate checks the course token

type StudentStorage

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

StudentStorage represents a service for managing students

func (*StudentStorage) AddStudent

func (s *StudentStorage) AddStudent(st *envy.Student) error

func (*StudentStorage) Enroll

func (s *StudentStorage) Enroll(st *envy.Student, c *envy.Course) error

func (*StudentStorage) Exists

func (s *StudentStorage) Exists(st *envy.Student) (bool, error)

func (*StudentStorage) List

func (s *StudentStorage) List() ([]*envy.Student, error)

func (*StudentStorage) RemoveStudent

func (s *StudentStorage) RemoveStudent(*envy.Student) error

func (*StudentStorage) Student

func (s *StudentStorage) Student(id int) (*envy.Student, error)

Directories

Path Synopsis
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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