Documentation ¶
Index ¶
- Variables
- func ChangeAuth(db *sqlx.DB, auth *Auth) error
- func CreateDatabaseSchema(db *sqlx.DB) error
- func InsertCourse(db *sqlx.DB, course *Course) error
- func InsertPost(db *sqlx.DB, post *Post) error
- func InsertProject(db *sqlx.DB, project *Project) error
- func MostRecent(db *sqlx.DB) (int, error)
- func OpenDB() (*sqlx.DB, error)
- func QuickChangeAuth(auth *Auth)
- func QuickInsertCourse(course *Course)
- func QuickInsertPost(post *Post)
- func QuickInsertProject(project *Project)
- func QuickMostRecent() int
- func QuickOpenDB() *sqlx.DB
- type Auth
- type Course
- func GetCourseBySerTitle(db *sqlx.DB, sertitle string) (*Course, error)
- func GetCourses(db *sqlx.DB) ([]*Course, error)
- func MakeNewCourse(sertitle string, title string, inst string, description string, ...) *Course
- func QuickGetCourseBySerTitle(sertitle string) *Course
- func QuickGetCourses() []*Course
- type Post
- func GetPost(db *sqlx.DB, id int) (*Post, error)
- func GetPosts(db *sqlx.DB) ([]*Post, error)
- func MakeNewPost(title string, author string, body string) *Post
- func MakeNewPostRaw(id int, title string, author string, body string, written time.Time) *Post
- func QuickGetPost(id int) *Post
- func QuickGetPosts() []*Post
- type Project
- func GetProjectByTitle(db *sqlx.DB, title string) (*Project, error)
- func GetProjects(db *sqlx.DB) ([]*Project, error)
- func MakeProject(title string, screenshots []string, language string, shortdesc string, ...) *Project
- func QuickGetProjectByTitle(title string) *Project
- func QuickGetProjects() []*Project
- type Schema
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // An error to desginate that a row doesn't exist RowDoesNotExistError error = errors.New("Row does not exist.") )
Functions ¶
func CreateDatabaseSchema ¶
Creating the database schema
func InsertPost ¶
Inserting a post into the database (it should be noted that the ID of the post is ignored, and is left to the SQL database's PRIMARY KEY to auto-increment)
Types ¶
type Auth ¶
type Auth struct { Id int // The id for the auth Username string // The username for the auth Password string // The password for the auth }
The auth type
func (*Auth) SecureString ¶
Converting the auth to a secure string
type Course ¶
type Course struct { Title string // The title of the course SerTitle string // The serialized version of the course title Inst string // The institution that offers the course Description string // The description of the course Comments string // My personal comments on the course }
func GetCourseBySerTitle ¶
Getting a course by its serialized title
func MakeNewCourse ¶
func MakeNewCourse(sertitle string, title string, inst string, description string, comments string) *Course
Making a new course object
func QuickGetCourseBySerTitle ¶
Quickly getting a course by its serialized title
type Post ¶
type Post struct { Id int // The ID of the post Title string // The title of the post Author string // The author of the post Body string // The body of the post Written time.Time // The time the post was written }
The post type
func MakeNewPost ¶
Making a new post, save id
func MakeNewPostRaw ¶
Making a new post
type Project ¶
type Project struct { Title string // The title of the project Screenshots []string // URLs to screenshots of the project in action Language string // The language the project was written in ShortDesc string // A short version of the description Description string // A description of the project }
func GetProjectByTitle ¶
Getting a project by its title
func MakeProject ¶
func MakeProject(title string, screenshots []string, language string, shortdesc string, description string) *Project
Making a new project object
func QuickGetProjectByTitle ¶
Quickly getting a project by its title
Click to show internal directories.
Click to hide internal directories.