db

package
v0.0.0-...-6813300 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColorMap = map[string]string{
	"blue":    "9",
	"brown":   "10",
	"default": "1",
	"gray":    "8",
	"green":   "2",
	"orange":  "6",
	"pink":    "4",
	"purple":  "3",
	"red":     "11",
	"yellow":  "5",
}

ColorMap is a map to convert from Notion colors to Google Calendar colors

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectID string `env:"GOOGLE_CLOUD_PROJECT_ID,notEmpty"`
}

type DatabaseService

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

func CreateService

func CreateService(ctx context.Context) (*DatabaseService, error)

func (*DatabaseService) AddEvent

func (ds *DatabaseService) AddEvent(ctx context.Context, event *Event) error

func (*DatabaseService) Close

func (ds *DatabaseService) Close() error

func (*DatabaseService) DeleteEvent

func (ds *DatabaseService) DeleteEvent(ctx context.Context, event *Event) error

func (*DatabaseService) ListEvents

func (ds *DatabaseService) ListEvents(ctx context.Context) ([]*Event, error)

func (*DatabaseService) SetEvent

func (ds *DatabaseService) SetEvent(ctx context.Context, event *Event) error

type Event

type Event struct {
	UUID                  string    `firestore:"uuid"`
	Title                 string    `firestore:"title"`
	StartTime             time.Time `firestore:"start_time"`
	EndTime               time.Time `firestore:"end_time"`
	CreatedTime           time.Time `firestore:"created_time"`
	UpdatedTime           time.Time `firestore:"updated_time"`
	Color                 string    `firestore:"color"`
	IsAllday              bool      `firestore:"is_all_day"`
	NotionEventID         string    `firestore:"notion_event_id"`
	GoogleCalendarEventID string    `firestore:"google_calendar_event_id"`
	Description           string    `firestore:"description"`
}

Event represents an event to be stored in the database

Jump to

Keyboard shortcuts

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