data_loader

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataLoader

type DataLoader interface {
	Init(conf interface{}) error
	LoadIntoStore(tap.AuthRegisterBackend) error
	Flush(tap.AuthRegisterBackend) error
}

DataLoader is an interface that defines how data is loaded from a source into a AuthRegisterBackend interface store

func CreateDataLoader

func CreateDataLoader(config configuration.Configuration, ProfileFilename string) (DataLoader, error)

type DumbLoader

type DumbLoader struct{}

DumbLoader does nothing, use for those cases where cache not needed so it's the same data store so call Flush and LoadIntoStore doesnt make sense

func (DumbLoader) Flush

func (DumbLoader) Init

func (DumbLoader) Init(conf interface{}) error

func (DumbLoader) LoadIntoStore

func (DumbLoader) LoadIntoStore(tap.AuthRegisterBackend) error

type FileLoader

type FileLoader struct {
	// contains filtered or unexported fields
}

FileLoader implements DataLoader and will load TAP Profiles from a file

func (*FileLoader) Flush

func (f *FileLoader) Flush(store tap.AuthRegisterBackend) error

func (*FileLoader) Init

func (f *FileLoader) Init(conf interface{}) error

Init initialises the file loader

func (*FileLoader) LoadIntoStore

func (f *FileLoader) LoadIntoStore(store tap.AuthRegisterBackend) error

LoadIntoStore will load, unmarshal and copy profiles into a an AuthRegisterBackend

type MongoLoader

type MongoLoader struct {
	SkipFlush bool
	// contains filtered or unexported fields
}

MongoLoader implements DataLoader and will load TAP Profiles from a file

func (*MongoLoader) Flush

func (m *MongoLoader) Flush(store tap.AuthRegisterBackend) error

Flush creates a backup of the current loaded config

func (*MongoLoader) Init

func (m *MongoLoader) Init(conf interface{}) error

Init initialises the mongo loader

func (*MongoLoader) LoadIntoStore

func (m *MongoLoader) LoadIntoStore(store tap.AuthRegisterBackend) error

LoadIntoStore will load, unmarshal and copy profiles into a an AuthRegisterBackend

type MongoLoaderConf

type MongoLoaderConf struct {
	ClientOpts *persistent.ClientOpts
}

MongoLoaderConf is the configuration struct for a MongoLoader

type ProfilesBackup

type ProfilesBackup struct {
	Timestamp int           `bson:"timestamp" json:"timestamp"`
	Profiles  []tap.Profile `bson:"profiles" json:"profiles"`
}

Jump to

Keyboard shortcuts

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