Compare commits
2 commits
2b888f203d
...
6498f3d56b
| Author | SHA1 | Date | |
|---|---|---|---|
| 6498f3d56b | |||
| e441e541c7 |
8 changed files with 243 additions and 2 deletions
16
app.go
16
app.go
|
|
@ -26,6 +26,7 @@ func NewApp(ver string, conf config.Config, db proc.Store) (*App, error) {
|
||||||
}
|
}
|
||||||
app := App{
|
app := App{
|
||||||
version: ver,
|
version: ver,
|
||||||
|
conf: conf,
|
||||||
}
|
}
|
||||||
|
|
||||||
selfIRI := boxap.DefaultServiceIRI(conf.BaseURL)
|
selfIRI := boxap.DefaultServiceIRI(conf.BaseURL)
|
||||||
|
|
@ -44,6 +45,10 @@ func (l *App) Config() config.Config {
|
||||||
return l.conf
|
return l.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l *App) Environment() config.Env {
|
||||||
|
return l.conf.Environment()
|
||||||
|
}
|
||||||
|
|
||||||
func (l *App) Storage() proc.Store {
|
func (l *App) Storage() proc.Store {
|
||||||
return l.storage
|
return l.storage
|
||||||
}
|
}
|
||||||
|
|
@ -64,6 +69,13 @@ func (l *App) Version() string {
|
||||||
return l.version
|
return l.version
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *App) String() string {
|
func (l *App) Name() string {
|
||||||
return fmt.Sprintf("Lenore (%s)", l.version)
|
if l.conf.Name == "" {
|
||||||
|
return "Lenore"
|
||||||
|
}
|
||||||
|
return l.conf.Name
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *App) String() string {
|
||||||
|
return fmt.Sprintf("%s (%s)", l.Name(), l.version)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
89
app_test.go
Normal file
89
app_test.go
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
package lenore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"codeberg.org/danjones000/lenore/config"
|
||||||
|
"codeberg.org/danjones000/lenore/internal/testmocks"
|
||||||
|
vocab "github.com/go-ap/activitypub"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestEmptyBaseURL(t *testing.T) {
|
||||||
|
c := config.Config{}
|
||||||
|
a, er := NewApp("0.0.0", c, testmocks.GetStore())
|
||||||
|
assert.Nil(t, a)
|
||||||
|
assert.EqualError(t, er, "Missing BaseURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDefaultEnvironment(t *testing.T) {
|
||||||
|
c := config.Config{BaseURL: "http://localhost:1234/"}
|
||||||
|
a, er := NewApp("0.0.0", c, testmocks.GetStore())
|
||||||
|
assert.NoError(t, er)
|
||||||
|
if assert.NotNil(t, a) {
|
||||||
|
assert.Equal(t, config.DEV, a.Environment())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGivenEnvironment(t *testing.T) {
|
||||||
|
cases := [...]struct {
|
||||||
|
given config.Env
|
||||||
|
exp config.Env
|
||||||
|
}{
|
||||||
|
{config.DEV, config.DEV},
|
||||||
|
{config.PROD, config.PROD},
|
||||||
|
{config.QA, config.QA},
|
||||||
|
{config.Env("foo"), config.DEV},
|
||||||
|
{config.Env("✨"), config.DEV},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range cases {
|
||||||
|
t.Run(string(c.given), func(t *testing.T) {
|
||||||
|
conf := config.Config{BaseURL: "http://localhost:1234/", Env: c.given}
|
||||||
|
a, er := NewApp("0.0.0", conf, testmocks.GetStore())
|
||||||
|
assert.NoError(t, er)
|
||||||
|
if assert.NotNil(t, a) {
|
||||||
|
assert.Equal(t, conf, a.Config())
|
||||||
|
assert.Equal(t, c.exp, a.Environment())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestService(t *testing.T) {
|
||||||
|
base := "http://localhost:1234/"
|
||||||
|
conf := config.Config{BaseURL: base}
|
||||||
|
a, er := NewApp("0.0.0.0", conf, testmocks.GetStore())
|
||||||
|
assert.NoError(t, er)
|
||||||
|
if assert.NotNil(t, a) {
|
||||||
|
assert.Equal(t, vocab.IRI(base), a.ServiceIRI())
|
||||||
|
assert.Equal(t, vocab.IRI(base), a.Service().ID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestStrings(t *testing.T) {
|
||||||
|
cases := [...]struct {
|
||||||
|
given string
|
||||||
|
exp string
|
||||||
|
}{
|
||||||
|
{"", "Lenore"},
|
||||||
|
{"Lenore", "Lenore"},
|
||||||
|
{"Danny Ray", "Danny Ray"},
|
||||||
|
{"✨👹", "✨👹"},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range cases {
|
||||||
|
t.Run(c.given, func(t *testing.T) {
|
||||||
|
conf := config.Config{BaseURL: "http://localhost:1234/", Name: c.given}
|
||||||
|
expStr := fmt.Sprintf("%s (%s)", c.exp, "0.0.0.0")
|
||||||
|
a, er := NewApp("0.0.0.0", conf, testmocks.GetStore())
|
||||||
|
assert.NoError(t, er)
|
||||||
|
if assert.NotNil(t, a) {
|
||||||
|
assert.Equal(t, c.exp, a.Name())
|
||||||
|
assert.Equal(t, "0.0.0.0", a.Version())
|
||||||
|
assert.Equal(t, expStr, a.String())
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
Name string
|
||||||
Env Env
|
Env Env
|
||||||
BaseURL string
|
BaseURL string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c Config) Environment() Env {
|
||||||
|
return ValidEnvOrDev(c.Env)
|
||||||
|
}
|
||||||
|
|
|
||||||
26
config/config_test.go
Normal file
26
config/config_test.go
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestEnvDefaultsToDev(t *testing.T) {
|
||||||
|
c := Config{}
|
||||||
|
assert.Equal(t, DEV, c.Environment())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestInvalidEnvReturnsDev(t *testing.T) {
|
||||||
|
c := Config{Env: Env("foobar")}
|
||||||
|
assert.Equal(t, DEV, c.Environment())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidEnvReturnsCorrect(t *testing.T) {
|
||||||
|
for _, e := range Envs {
|
||||||
|
t.Run(string(e), func(t *testing.T) {
|
||||||
|
c := Config{Env: e}
|
||||||
|
assert.Equal(t, e, c.Environment())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
59
config/env_test.go
Normal file
59
config/env_test.go
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestEnvString(t *testing.T) {
|
||||||
|
cases := Envs[:]
|
||||||
|
cases = append(cases, Env("foobar"), Env(""), Env("42"), Env("✨"))
|
||||||
|
for _, e := range cases {
|
||||||
|
t.Run(string(e), func(t *testing.T) {
|
||||||
|
assert.Equal(t, string(e), e.String())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidEnv(t *testing.T) {
|
||||||
|
cases := [...]struct {
|
||||||
|
e Env
|
||||||
|
exp bool
|
||||||
|
}{
|
||||||
|
{DEV, true},
|
||||||
|
{PROD, true},
|
||||||
|
{QA, true},
|
||||||
|
{TEST, true},
|
||||||
|
{Env("foobar"), false},
|
||||||
|
{Env(""), false},
|
||||||
|
{Env("✨"), false},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range cases {
|
||||||
|
t.Run(string(c.e), func(t *testing.T) {
|
||||||
|
assert.Equal(t, c.exp, ValidEnv(c.e))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidEnvOrDev(t *testing.T) {
|
||||||
|
cases := [...]struct {
|
||||||
|
give Env
|
||||||
|
exp Env
|
||||||
|
}{
|
||||||
|
{DEV, DEV},
|
||||||
|
{PROD, PROD},
|
||||||
|
{QA, QA},
|
||||||
|
{TEST, TEST},
|
||||||
|
{Env("foobar"), DEV},
|
||||||
|
{Env(""), DEV},
|
||||||
|
{Env("✨"), DEV},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range cases {
|
||||||
|
t.Run(string(c.give), func(t *testing.T) {
|
||||||
|
assert.Equal(t, c.exp, ValidEnvOrDev(c.give))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
4
go.mod
4
go.mod
|
|
@ -8,6 +8,7 @@ require (
|
||||||
github.com/go-ap/fedbox v0.0.0-20240910163620-7bcedb2eb399
|
github.com/go-ap/fedbox v0.0.0-20240910163620-7bcedb2eb399
|
||||||
github.com/go-ap/processing v0.0.0-20240910151355-8284a5ce9c22
|
github.com/go-ap/processing v0.0.0-20240910151355-8284a5ce9c22
|
||||||
github.com/go-ap/storage-sqlite v0.0.0-20240910151457-20fa80d963aa
|
github.com/go-ap/storage-sqlite v0.0.0-20240910151457-20fa80d963aa
|
||||||
|
github.com/stretchr/testify v1.9.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|
@ -15,6 +16,7 @@ require (
|
||||||
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
|
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
|
||||||
git.sr.ht/~mariusor/lw v0.0.0-20240906100438-00d2184b2120 // indirect
|
git.sr.ht/~mariusor/lw v0.0.0-20240906100438-00d2184b2120 // indirect
|
||||||
git.sr.ht/~mariusor/ssm v0.0.0-20240811085540-34f24cac52b7 // indirect
|
git.sr.ht/~mariusor/ssm v0.0.0-20240811085540-34f24cac52b7 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/go-ap/cache v0.0.0-20240910141827-94f8ac1a9133 // indirect
|
github.com/go-ap/cache v0.0.0-20240910141827-94f8ac1a9133 // indirect
|
||||||
github.com/go-ap/errors v0.0.0-20240910140019-1e9d33cc1568 // indirect
|
github.com/go-ap/errors v0.0.0-20240910140019-1e9d33cc1568 // indirect
|
||||||
|
|
@ -31,6 +33,7 @@ require (
|
||||||
github.com/ncruces/go-strftime v0.1.9 // indirect
|
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||||
github.com/openshift/osin v1.0.2-0.20220317075346-0f4d38c6e53f // indirect
|
github.com/openshift/osin v1.0.2-0.20220317075346-0f4d38c6e53f // indirect
|
||||||
github.com/pborman/uuid v1.2.1 // indirect
|
github.com/pborman/uuid v1.2.1 // indirect
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||||
github.com/rs/xid v1.6.0 // indirect
|
github.com/rs/xid v1.6.0 // indirect
|
||||||
github.com/rs/zerolog v1.33.0 // indirect
|
github.com/rs/zerolog v1.33.0 // indirect
|
||||||
|
|
@ -39,6 +42,7 @@ require (
|
||||||
golang.org/x/oauth2 v0.23.0 // indirect
|
golang.org/x/oauth2 v0.23.0 // indirect
|
||||||
golang.org/x/sys v0.25.0 // indirect
|
golang.org/x/sys v0.25.0 // indirect
|
||||||
golang.org/x/text v0.18.0 // indirect
|
golang.org/x/text v0.18.0 // indirect
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a // indirect
|
modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a // indirect
|
||||||
modernc.org/mathutil v1.6.0 // indirect
|
modernc.org/mathutil v1.6.0 // indirect
|
||||||
modernc.org/memory v1.8.0 // indirect
|
modernc.org/memory v1.8.0 // indirect
|
||||||
|
|
|
||||||
8
go.sum
8
go.sum
|
|
@ -10,6 +10,8 @@ git.sr.ht/~mariusor/ssm v0.0.0-20240811085540-34f24cac52b7/go.mod h1:VApG24PG5Ij
|
||||||
github.com/carlmjohnson/be v0.23.2 h1:1QjPnPJhwGUjsD9+7h98EQlKsxnG5TV+nnEvk0wnkls=
|
github.com/carlmjohnson/be v0.23.2 h1:1QjPnPJhwGUjsD9+7h98EQlKsxnG5TV+nnEvk0wnkls=
|
||||||
github.com/carlmjohnson/be v0.23.2/go.mod h1:KAgPUh0HpzWYZZI+IABdo80wTgY43YhbdsiLYAaSI/Q=
|
github.com/carlmjohnson/be v0.23.2/go.mod h1:KAgPUh0HpzWYZZI+IABdo80wTgY43YhbdsiLYAaSI/Q=
|
||||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||||
|
|
@ -75,6 +77,8 @@ github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
|
||||||
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
|
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
|
||||||
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
|
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
|
||||||
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
|
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
|
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
|
||||||
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
|
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
|
@ -107,7 +111,11 @@ golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||||
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
|
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
|
||||||
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
|
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/square/go-jose.v1 v1.1.2/go.mod h1:QpYS+a4WhS+DTlyQIi6Ka7MS3SuR9a055rgXNEe6EiA=
|
gopkg.in/square/go-jose.v1 v1.1.2/go.mod h1:QpYS+a4WhS+DTlyQIi6Ka7MS3SuR9a055rgXNEe6EiA=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
|
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
|
||||||
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
|
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
|
||||||
modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a h1:CfbpOLEo2IwNzJdMvE8aiRbPMxoTpgAJeyePh0SmO8M=
|
modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a h1:CfbpOLEo2IwNzJdMvE8aiRbPMxoTpgAJeyePh0SmO8M=
|
||||||
|
|
|
||||||
38
internal/testmocks/store.go
Normal file
38
internal/testmocks/store.go
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
package testmocks
|
||||||
|
|
||||||
|
import (
|
||||||
|
vocab "github.com/go-ap/activitypub"
|
||||||
|
"github.com/go-ap/filters"
|
||||||
|
proc "github.com/go-ap/processing"
|
||||||
|
)
|
||||||
|
|
||||||
|
type st struct{}
|
||||||
|
|
||||||
|
func (s *st) Load(iri vocab.IRI, filters ...filters.Check) (vocab.Item, error) {
|
||||||
|
i := vocab.ActorNew(iri, vocab.ActorType)
|
||||||
|
return i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *st) Save(v vocab.Item) (vocab.Item, error) {
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *st) Delete(v vocab.Item) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *st) Create(col vocab.CollectionInterface) (vocab.CollectionInterface, error) {
|
||||||
|
return col, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *st) AddTo(col vocab.IRI, it vocab.Item) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *st) RemoveFrom(col vocab.IRI, it vocab.Item) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetStore() proc.Store {
|
||||||
|
return &st{}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue