dao

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dao provides data abstraction objects and database connection functions for the jellytest test server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	DB *sql.DB

	NiceTemplates   Templates
	RudeTemplates   Templates
	SecretTemplates Templates
	EchoTemplates   Templates
}

func (Datastore) Close

func (ds Datastore) Close() error

type Template

type Template struct {
	ID      uuid.UUID
	Content string
	Creator uuid.UUID
}

func (Template) ModelID

func (m Template) ModelID() uuid.UUID

type Templates

type Templates interface {
	Create(context.Context, Template) (Template, error)
	Get(context.Context, uuid.UUID) (Template, error)
	GetAll(context.Context) ([]Template, error)
	Update(context.Context, uuid.UUID, Template) (Template, error)
	Delete(context.Context, uuid.UUID) (Template, error)
	GetRandom(context.Context) (Template, error)
	Close() error
}

TODO: this has nothing to do with jelly/dao's Repos. Should that be updated to be specific to jellyauth and moved out of general DAO?

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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