config

package
v0.0.0-...-ded11e2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigName containes the name of the configuration file
	ConfigName = "config"
	// ConfigType containes the type of the configuration file
	ConfigType = "yaml"
	// ConfigFolder containes the name of the folder that the
	// config file is located
	ConfigFolder = ".ditctl"
)

Variables

View Source
var (
	// ConfigDirPath is the DIR path that containes the config file
	ConfigDirPath string
)

Functions

func AddReminder

func AddReminder(r Reminder) error

func CreateEmpty

func CreateEmpty(path string) (err error)

func SetCredentials

func SetCredentials(c Credentials) error

func SetReminders

func SetReminders(rs []Reminder) error

func SetSemesters

func SetSemesters(s []Semester) error

Types

type Credentials

type Credentials struct {
	Username string
	Password string
}

func GetCredentials

func GetCredentials() (c Credentials)

type Lesson

type Lesson struct {
	// ID is the url id needed to fetch more informatio about the lesson
	// ex https://www.di.uoa.gr/studies/undergraduate/31 where ID = 31
	ID        string
	Name      string
	Code      string
	Ects      string
	Necessity string
	S1        string
	S2        string
	S3        string
	S4        string
	S5        string
	S6        string
}

type Reminder

type Reminder struct {
	ID          int
	Time        string
	Description string
}

Reminder defines the fields of a reminder

func GetReminders

func GetReminders() (rs []Reminder)

func NewReminder

func NewReminder(givenDay string, givenTime string, givenDiscription []string) (r Reminder, err error)

NewReminder creates a new reminder from the user input

type Semester

type Semester struct {
	Number  int
	Lessons []Lesson
}

func GetSemesters

func GetSemesters() (s []Semester)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳