service

package
v0.0.0-...-89fe5e3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(filepath string, url string) error

func Scraper

func Scraper(groupname webapi.Group) []webapi.Event

func Serialize

func Serialize(events MyEvents)

Types

type AuthService

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

func NewAuthService

func NewAuthService(repo repository.Authorization) *AuthService

func (*AuthService) CreateUser

func (s *AuthService) CreateUser(user webApi.User) (int, error)

func (*AuthService) GenerateToken

func (s *AuthService) GenerateToken(username, password string) (string, error)

func (*AuthService) ParseToken

func (s *AuthService) ParseToken(accessToken string) (int, error)

type Authorization

type Authorization interface {
	CreateUser(user webApi.User) (int, error)
	GenerateToken(username, password string) (string, error)
	ParseToken(token string) (int, error)
}

type Categories

type Categories interface {
	Create(userId int, category webApi.Category) (int, error)
	GetAll(userId int) ([]webApi.Category, error)
	GetById(userId, id int) (webApi.Category, error)
	Delete(userId, id int) error
	Update(userId, id int, input webApi.UpdateCategoryInput) error
}

type CategoryService

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

func NewCategoryService

func NewCategoryService(repo repository.Category) *CategoryService

func (*CategoryService) Create

func (s *CategoryService) Create(userId int, category webApi.Category) (int, error)

func (*CategoryService) Delete

func (s *CategoryService) Delete(userId, id int) error

func (*CategoryService) GetAll

func (s *CategoryService) GetAll(userId int) ([]webApi.Category, error)

func (*CategoryService) GetById

func (s *CategoryService) GetById(userId, id int) (webApi.Category, error)

func (*CategoryService) Update

func (s *CategoryService) Update(userId, id int, input webApi.UpdateCategoryInput) error

type EventService

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

func NewEventService

func NewEventService(repo repository.Event) *EventService

func (*EventService) Create

func (s *EventService) Create(userId int, event webApi.Event) (int, error)

func (*EventService) Delete

func (s *EventService) Delete(userId, id int) error

func (*EventService) Download

func (s *EventService) Download(userId int)

func (*EventService) GetAll

func (s *EventService) GetAll(userId int) ([]webApi.Event, error)

func (*EventService) GetById

func (s *EventService) GetById(userId int, id int) (webApi.Event, error)

func (*EventService) GetSchedule

func (s *EventService) GetSchedule(userId int, group webApi.Group) ([]webApi.Event, error)

func (*EventService) Update

func (s *EventService) Update(userId, id int, input webApi.UpdateEventInput) error

type Events

type Events interface {
	Create(userId int, event webApi.Event) (int, error)
	GetAll(userId int) ([]webApi.Event, error)
	GetById(userId, id int) (webApi.Event, error)
	GetSchedule(userId int, group webApi.Group) ([]webApi.Event, error)
	Delete(userId, id int) error
	Download(userId int)
	Update(userId, id int, input webApi.UpdateEventInput) error
}

type MyEvents

type MyEvents []webapi.Event

func (MyEvents) EmitICal

func (e MyEvents) EmitICal() goics.Componenter

type NotionService

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

func NewNotionService

func NewNotionService(repo repository.Notion) *NotionService

func (*NotionService) Create

func (s *NotionService) Create(userId int, notion webApi.Notion) (int, error)

func (*NotionService) Delete

func (s *NotionService) Delete(userId, id int) error

func (*NotionService) GetAll

func (s *NotionService) GetAll(userId int) ([]webApi.Notion, error)

func (*NotionService) GetById

func (s *NotionService) GetById(userId, id int) (webApi.Notion, error)

func (*NotionService) Update

func (s *NotionService) Update(userId, id int, input webApi.UpdateNotionInput) error

type Notions

type Notions interface {
	GetAll(userId int) ([]webApi.Notion, error)
	GetById(userId, id int) (webApi.Notion, error)
	Create(userId int, notion webApi.Notion) (int, error)
	Delete(userId, id int) error
	Update(userId, id int, input webApi.UpdateNotionInput) error
}

type Service

func NewService

func NewService(repos *repository.Repository) *Service

type TaskService

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

func NewTaskService

func NewTaskService(repo repository.Task) *TaskService

func (*TaskService) Create

func (s *TaskService) Create(userId int, task webApi.Task) (int, error)

func (*TaskService) Delete

func (s *TaskService) Delete(userId, id int) error

func (*TaskService) GetAll

func (s *TaskService) GetAll(userId int) ([]webApi.Task, error)

func (*TaskService) GetById

func (s *TaskService) GetById(userId, id int) (webApi.Task, error)

func (*TaskService) Update

func (s *TaskService) Update(userId, id int, input webApi.UpdateTaskInput) error

type Tasks

type Tasks interface {
	GetAll(userId int) ([]webApi.Task, error)
	GetById(userId, id int) (webApi.Task, error)
	Create(userId int, task webApi.Task) (int, error)
	Delete(userId, id int) error
	Update(userId, id int, input webApi.UpdateTaskInput) error
}

type User

type User interface {
	Get(userId int) (webApi.UsernameInfo, error)
}

type UserService

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

func NewUserService

func NewUserService(repo repository.User) *UserService

func (*UserService) Get

func (s *UserService) Get(userId int) (webApi.UsernameInfo, error)

type Week

type Week interface {
	GetDays(usedId int, input webApi.WeekRequest) ([]webApi.Day, error)
}

type WeekService

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

func NewWeekService

func NewWeekService(repo repository.Week) *WeekService

func (*WeekService) GetDays

func (s *WeekService) GetDays(userId int, input webApi.WeekRequest) ([]webApi.Day, error)

Directories

Path Synopsis
Package goics is a toolkit for encoding and decoding ics/Ical/icalendar files.
Package goics is a toolkit for encoding and decoding ics/Ical/icalendar files.

Jump to

Keyboard shortcuts

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