mongo

package
v0.0.0-...-c11ca93 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name string = "MongoDb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO
	WARNING
	ERROR
)

type MongoDatabase

type MongoDatabase struct {
	Ip string `json:"ip"`
	// contains filtered or unexported fields
}

func NewMongoDatase

func NewMongoDatase(config *json.RawMessage) (d *MongoDatabase, err error)

func (*MongoDatabase) AddAccount

func (d *MongoDatabase) AddAccount(account *types.Account) (err error)
func (d *MongoDatabase) AddDownloadLink(link *types.DownloadLink) (err error)

func (*MongoDatabase) ClearAccesses

func (d *MongoDatabase) ClearAccesses() error

func (*MongoDatabase) DeleteCommand

func (d *MongoDatabase) DeleteCommand(ref *string) error

func (*MongoDatabase) GetAccess

func (d *MongoDatabase) GetAccess(user *string, path string) (api.AccessType, error)

func (*MongoDatabase) GetAccount

func (d *MongoDatabase) GetAccount(authType string, ref string) (account *types.Account, id string, err error)

func (*MongoDatabase) GetCommand

func (d *MongoDatabase) GetCommand(ref string) (command *types.Command, err error)
func (d *MongoDatabase) GetDownloadLink(ref string) (link *types.DownloadLink, err error)

func (*MongoDatabase) GetSession

func (d *MongoDatabase) GetSession(ref string) (session *types.Session, err error)
func (d *MongoDatabase) GetShareLink(key string) (shareLink *types.ShareLink, err error)

func (*MongoDatabase) GetShareLinksFromPath

func (d *MongoDatabase) GetShareLinksFromPath(path string, user string) (shareLink []*types.ShareLink, err error)

func (*MongoDatabase) GetUserAccount

func (d *MongoDatabase) GetUserAccount(id string) (account *types.Account, err error)

func (*MongoDatabase) ListAccounts

func (d *MongoDatabase) ListAccounts(searchDict map[string]string) (accounts []*types.Account, err error)

func (*MongoDatabase) ListCommands

func (d *MongoDatabase) ListCommands(user *string, offset int, limit int, search_parameters *api.CommandsSearchParameters) ([]*types.Command, int, error)
func (d *MongoDatabase) ListShareLinks(user string) (shareLinks []*types.ShareLink, err error)

func (*MongoDatabase) Log

func (d *MongoDatabase) Log(level LogLevel, message string)

func (*MongoDatabase) Name

func (d *MongoDatabase) Name() string

func (*MongoDatabase) RemoveSession

func (d *MongoDatabase) RemoveSession(ref string) (err error)
func (d *MongoDatabase) RemoveShareLink(key string) (err error)

func (*MongoDatabase) SaveCommand

func (d *MongoDatabase) SaveCommand(command *types.Command) (err error)
func (d *MongoDatabase) SaveShareLink(shareLink *types.ShareLink) (err error)

func (*MongoDatabase) SetAccess

func (d *MongoDatabase) SetAccess(user *string, path string, access api.AccessType) error

func (*MongoDatabase) StoreSession

func (d *MongoDatabase) StoreSession(session *types.Session) (err error)

func (*MongoDatabase) UpdateAccount

func (d *MongoDatabase) UpdateAccount(id string, account *types.Account) (err error)
func (d *MongoDatabase) UpdateShareLink(shareLink *types.ShareLink) (err error)

Jump to

Keyboard shortcuts

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