~f4814n/frost

ref: 56ea6369ea905c8c600f6faf07e22914cb552aa8 frost/cmd/frost/platform_js.go -rw-r--r-- 659 bytes
56ea6369Fabian Geiselhart Build: Fix .apk signing 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"
	"git.sr.ht/~f4814n/matrix/util/cache"
	backend "git.sr.ht/~f4814n/matrix/backend/memory"
	"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()
}