datastore

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManager

func NewManager(p string) (kilonova.DataStore, error)

NewManager returns a new manager instance

Types

type StorageManager

type StorageManager struct {
	RootPath string
	// contains filtered or unexported fields
}

StorageManager helps open the files in the data directory, this is supposed to be data that should not be stored in the DB

func (*StorageManager) AttachmentRenderPath

func (m *StorageManager) AttachmentRenderPath(attID int, renderType string) string

func (*StorageManager) DelAttachmentRender

func (m *StorageManager) DelAttachmentRender(attID int, renderType string) error

func (*StorageManager) DelAttachmentRenders

func (m *StorageManager) DelAttachmentRenders(attID int) error

func (*StorageManager) GetAttachmentRender

func (m *StorageManager) GetAttachmentRender(attID int, renderType string) (io.ReadCloser, error)

func (*StorageManager) GetAvatar

func (m *StorageManager) GetAvatar(email string, size int, maxLastMod time.Time) (io.ReadSeeker, time.Time, bool, error)

func (*StorageManager) HasAttachmentRender

func (m *StorageManager) HasAttachmentRender(attID int, renderType string) bool

TODO: Has ... Get may not be the best pattern

func (*StorageManager) InvalidateAllAttachments

func (m *StorageManager) InvalidateAllAttachments() error

func (*StorageManager) PurgeAvatarCache

func (m *StorageManager) PurgeAvatarCache() error

func (*StorageManager) PurgeTestData

func (m *StorageManager) PurgeTestData(testID int) error

func (*StorageManager) SaveAttachmentRender

func (m *StorageManager) SaveAttachmentRender(attID int, renderType string, data []byte) error

func (*StorageManager) SaveAvatar

func (m *StorageManager) SaveAvatar(email string, size int, r io.Reader) error

func (*StorageManager) SaveTestInput

func (m *StorageManager) SaveTestInput(testID int, input io.Reader) error

func (*StorageManager) SaveTestOutput

func (m *StorageManager) SaveTestOutput(testID int, output io.Reader) error

func (*StorageManager) SubtestPath

func (m *StorageManager) SubtestPath(subtest int) string

func (*StorageManager) SubtestReader

func (m *StorageManager) SubtestReader(subtest int) (io.ReadCloser, error)

SubtestReader should be used by the grader

func (*StorageManager) SubtestWriter

func (m *StorageManager) SubtestWriter(subtest int) (io.WriteCloser, error)

SubtestWriter should be used by the eval server

func (*StorageManager) TestInput

func (m *StorageManager) TestInput(testID int) (io.ReadCloser, error)

func (*StorageManager) TestInputPath

func (m *StorageManager) TestInputPath(testID int) string

func (*StorageManager) TestOutput

func (m *StorageManager) TestOutput(testID int) (io.ReadCloser, error)

func (*StorageManager) TestOutputPath

func (m *StorageManager) TestOutputPath(testID int) string

Jump to

Keyboard shortcuts

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