postgres_backend

package
v0.0.0-...-c4d1539 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnection

func GetConnection() (*sql.DB, error)

func IdDoesNotExistError

func IdDoesNotExistError(objectName string, id int64) error

Types

type CodeStore

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

func NewCodeStore

func NewCodeStore(connection *sql.DB) CodeStore

func (CodeStore) CodifyText

func (c CodeStore) CodifyText(codeId store.CodeId, documentId store.FileId, text string, firstWord store.WordCoordinate, lastWord store.WordCoordinate) (store.TextId, error)

func (CodeStore) CreateCode

func (c CodeStore) CreateCode(name string, containerId store.ContainerId) (store.CodeId, error)

func (CodeStore) CreateContainer

func (c CodeStore) CreateContainer(id store.ProjectId) (store.ContainerId, error)

func (CodeStore) DeleteText

func (c CodeStore) DeleteText(textId store.TextId) error

func (CodeStore) GetCode

func (c CodeStore) GetCode(codeId store.CodeId) (store.Code, error)

func (CodeStore) GetContainer

func (c CodeStore) GetContainer(containerId store.ContainerId) (store.CodeContainer, error)

func (CodeStore) GetContainers

func (c CodeStore) GetContainers(id store.ProjectId) ([]store.CodeContainer, error)

type DefaultFileSys

type DefaultFileSys struct {
}

func (DefaultFileSys) Fetch

func (d DefaultFileSys) Fetch(filepath string) ([]byte, error)

func (DefaultFileSys) Store

func (d DefaultFileSys) Store(filepath string, contents []byte) error

type FileStore

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

func NewFileStore

func NewFileStore(writeLocation string, con *sql.DB) FileStore

func (FileStore) GetFile

func (c FileStore) GetFile(id store.FileId) ([]byte, store.File, error)

func (FileStore) GetFiles

func (c FileStore) GetFiles(id store.ProjectId) ([]store.File, error)

func (FileStore) UploadFile

func (c FileStore) UploadFile(filename string, contents []byte, projectId store.ProjectId, fileType store.FileType) (store.File, error)

type FileSys

type FileSys interface {
	Store(filepath string, contents []byte) error
	Fetch(filepath string) ([]byte, error)
}

type ProjectStore

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

func NewProjectStore

func NewProjectStore(con *sql.DB) ProjectStore

func (ProjectStore) CreateProject

func (p ProjectStore) CreateProject(name, description string, month, year int) (store.ProjectId, error)

func (ProjectStore) GetProject

func (p ProjectStore) GetProject(id store.ProjectId) (store.Project, error)

func (ProjectStore) GetProjects

func (p ProjectStore) GetProjects() ([]store.Project, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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