store

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestDir

func CreateTestDir() string

func StubTestCodeStore

func StubTestCodeStore(t *testing.T, codeBackend CodeStore, fileBackend FileStore, projectId ProjectId)

func StubTestStore

func StubTestStore(t *testing.T, fileBackend FileStore, projectId ProjectId)

TestFSBackend covers all the file interface methods

Types

type Code

type Code = swagger.Code

type CodeContainer

type CodeContainer = swagger.CodeContainer

type CodeId

type CodeId = int64

type CodeMap

type CodeMap = map[CodeId]Code

type CodeParentIdMap

type CodeParentIdMap = map[CodeId][]CodeId

type CodeStore

type CodeStore interface {
	CreateContainer(id ProjectId) (ContainerId, error)
	CreateCode(name string, containerId ContainerId) (CodeId, error)
	CodifyText(codeId CodeId, documentId FileId, text string, firstWord WordCoordinate, lastWord WordCoordinate) (TextId, error)
	DeleteText(textId TextId) error
	GetCode(codeId CodeId) (Code, error)
	GetContainer(codeId ContainerId) (CodeContainer, error)
	GetContainers(id ProjectId) ([]CodeContainer, error)
}

type ContainerId

type ContainerId = int64

type DocumentText

type DocumentText = swagger.DocumentText

type File

type File = swagger.File

type FileId

type FileId = int64

type FileStore

type FileStore interface {
	UploadFile(filename string, contents []byte, id ProjectId, fileType FileType) (File, error)
	GetFile(id FileId) ([]byte, File, error)
	GetFiles(id ProjectId) ([]File, error)
}

type FileType

type FileType = string
const (
	SourceFile FileType = "KSOURCE"
	DemoFile   FileType = "KDEMO"
)

type Project

type Project = swagger.Project

type ProjectId

type ProjectId = int64

type ProjectStore

type ProjectStore interface {
	CreateProject(name, description string, month, year int) (ProjectId, error)
	GetProject(id ProjectId) (Project, error)
	GetProjects() ([]Project, error)
}

type TextId

type TextId = int64

type WordCoordinate

type WordCoordinate = swagger.WordCoordinate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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