database

package
v0.0.0-...-f72932a Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	ActivityID     string    `json:"activity_id"`
	SubjectID      string    `json:"subject_id"`
	AssignedUserID string    `json:"assigned_user_id"`
	Name           string    `json:"name"`
	Location       string    `json:"location"`
	Description    string    `json:"description"`
	StartTime      time.Time `json:"start_time"`
}

type Client

type Client struct {
	DB *pgxpool.Pool
}

func NewDatabaseClient

func NewDatabaseClient(variables variables.Variables) (client Client, err error)

func (Client) AddActivity

func (c Client) AddActivity(ctx context.Context, activity Activity) (Activity, error)

func (Client) AddSubject

func (c Client) AddSubject(ctx context.Context, subject Subject) (Subject, error)

func (Client) GetActivities

func (c Client) GetActivities(ctx context.Context, assignedUserID string) (activities []Activity, err error)

func (Client) GetActivity

func (c Client) GetActivity(ctx context.Context, activityID string) (activity Activity, err error)

func (Client) GetSubject

func (c Client) GetSubject(ctx context.Context, subjectID string) (subject Subject, err error)

func (Client) GetSubjects

func (c Client) GetSubjects(ctx context.Context) (subjects []Subject, err error)

func (Client) RemoveActivity

func (c Client) RemoveActivity(ctx context.Context, activityID string) error

func (Client) RemoveSubject

func (c Client) RemoveSubject(ctx context.Context, subjectID string) error

type Subject

type Subject struct {
	SubjectID string `json:"subject_id"`
	Name      string `json:"name"`
	ImageURL  string `json:"image_url"`
}

Jump to

Keyboard shortcuts

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