store

package
v0.0.0-...-f0d4de4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBEntry

type DBEntry struct {
	Key          string `json:"simulation_key"`
	GitHash      string `json:"git_hash"`
	HashedConfig string `json:"config_hash"`
	Author       int64  `json:"author"`
	AuthorString string `json:"author_string,omitempty"`
	Description  string `json:"sim_description"`
}

func (*DBEntry) ConvertConfig

func (d *DBEntry) ConvertConfig() error

type PostgRESTStore

type PostgRESTStore struct {
	URL string
	// contains filtered or unexported fields
}

func NewPostgRESTStore

func NewPostgRESTStore(url string) *PostgRESTStore

func (*PostgRESTStore) Add

func (b *PostgRESTStore) Add(entry DBEntry) (int64, error)

func (*PostgRESTStore) Delete

func (b *PostgRESTStore) Delete(key string) (int64, error)

func (*PostgRESTStore) Fetch

func (b *PostgRESTStore) Fetch(key string) (Simulation, error)

func (*PostgRESTStore) List

func (b *PostgRESTStore) List(key string) ([]SimInfo, error)

func (*PostgRESTStore) Replace

func (b *PostgRESTStore) Replace(key string, entry DBEntry) (int64, error)

type Result

type Result struct {
	Config string `json:"config_file"`
}

type SimDBStore

type SimDBStore interface {
	Add(entry DBEntry) (int64, error)
	Replace(key string, entry DBEntry) (int64, error)
	List(char string) ([]SimInfo, error)
	Delete(key string) (int64, error)
}

type SimInfo

type SimInfo struct {
	Key         string `json:"simulation_key"`
	Description string `json:"sim_description"`
}

type SimStore

type SimStore interface {
	Fetch(url string) (Simulation, error)
}

type Simulation

type Simulation struct {
	Metadata    string `json:"metadata"`
	ViewerFile  string `json:"viewer_file"`
	IsPermanent bool   `json:"is_permanent"`
}

func (*Simulation) DecodeViewer

func (s *Simulation) DecodeViewer() (*Result, error)

Jump to

Keyboard shortcuts

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