~f4814n/frost

ref: 8ce23f36008a3001c34aac6bb8751d0d91bc336c frost/cmd/frost/platform_js.go -rw-r--r-- 663 bytes
8ce23f36Fabian Geiselhart gofmt -w ./.. 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main

import (
	"git.sr.ht/~f4814n/matrix"
	backend "git.sr.ht/~f4814n/matrix/backend/memory"
	"git.sr.ht/~f4814n/matrix/util/cache"
	"github.com/sirupsen/logrus"
)

type Platform struct {
	log   *logrus.Entry
	Cache cache.Cache
}

func InitPlatform() Platform {
	return Platform{
		Cache: new(cache.MemoryCache),
		log:   logrus.WithField("component", "platform_js"),
	}
}

func (p Platform) LoadConfig() (cfg AppConfig, err error) {
	p.log.Warn("This platform does not support persisting information")
	return
}

func (p Platform) FlushConfig(cfg AppConfig) error {
	return nil
}

func (p Platform) NewBackend() matrix.Backend {
	return backend.New()
}