MCPcopy
hub / github.com/mattermost/mattermost / BackingStore

Interface BackingStore

server/config/store.go:42–68  ·  view source on GitHub ↗

BackingStore defines the behaviour exposed by the underlying store implementation (e.g. file, database).

Source from the content-addressed store, hash-verified

40// BackingStore defines the behaviour exposed by the underlying store
41// implementation (e.g. file, database).
42type BackingStore interface {
43 // Set replaces the current configuration in its entirety and updates the backing store.
44 Set(*model.Config) error
45
46 // Load retrieves the configuration stored. If there is no configuration stored
47 // the io.ReadCloser will be nil
48 Load() ([]byte, error)
49
50 // GetFile fetches the contents of a previously persisted configuration file.
51 // If no such file exists, an empty byte array will be returned without error.
52 GetFile(name string) ([]byte, error)
53
54 // SetFile sets or replaces the contents of a configuration file.
55 SetFile(name string, data []byte) error
56
57 // HasFile returns true if the given file was previously persisted.
58 HasFile(name string) (bool, error)
59
60 // RemoveFile removes a previously persisted configuration file.
61 RemoveFile(name string) error
62
63 // String describes the backing store for the config.
64 String() string
65
66 // Close cleans up resources associated with the store.
67 Close() error
68}
69
70// NewStoreFromBacking creates and returns a new config store given a backing store.
71func NewStoreFromBacking(backingStore BackingStore, customDefaults *model.Config, readOnly bool) (*Store, error) {

Callers 60

TestLicenseFunction · 0.65
validUsingSquirrelFunction · 0.65
TestImportProcessCmdFMethod · 0.65
TestListOAuthAppsCmdMethod · 0.65
TestCPAValueSetMethod · 0.65
SetPluginErrorMethod · 0.65
getPluginErrorMethod · 0.65
GetPluginStateMethod · 0.65
setPluginStateMethod · 0.65

Implementers 4

DatabaseStoreserver/config/database.go
FileStoreserver/config/file.go
Storeserver/config/store.go
MemoryStoreserver/config/memory.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…