wotoDB

package
v0.0.0-...-f800b22 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainDataBase dbTypes.DATABASE = "bgrsx76y6idxwuk" // wConfig
	PatDataBase  dbTypes.DATABASE = "bqvkw7yvsxypyuj" // pat
)

databases' name used in the app.

View Source
const (
	// ConfigurationCollection is for configuration of the bot.
	ConfigurationCollection dbTypes.COLLECTION = "Configuration"

	SUDOs_INFO dbTypes.COLLECTION = "SudoInfo"

	PatListCollection  dbTypes.COLLECTION = "Pat"
	HPatListCollection dbTypes.COLLECTION = "HPat"
	// UsersCollection is the main user collection :/
	UsersCollection dbTypes.COLLECTION = "Users"
	// SecuredCollection
	SecuredCollection dbTypes.COLLECTION = "Secured"
	// PlayerInfoCollection
	PlayerInfoCollection dbTypes.COLLECTION = "PlayerInfo"
	// OnlineTokenCollection
	OnlineTokenCollection dbTypes.COLLECTION = "OnlineTokens"
)
View Source
const (
	RAW_CONFIG_CLIENT dbTypes.DB_INDEX = 1
	PAT_CLIENT        dbTypes.DB_INDEX = 2
)

Variables

This section is empty.

Functions

func GenerateClient

func GenerateClient(index dbTypes.DB_INDEX) (wa.RESULT, interfaces.WClient)

GenerateClient will generate a new data base client for you, if and only if there is no client defined in the program. before calling this function, create a new settings in the app.

func GenerateClients

func GenerateClients(settings interfaces.WSettings)

GenerateClients will generate all woto clients used in the app.

Types

type WotoClient

type WotoClient struct {
	HostAddress string
	// contains filtered or unexported fields
}

the WotoClient struct which will act as a client in the program

func (*WotoClient) AccountsLength

func (_c *WotoClient) AccountsLength() int

func (*WotoClient) AddGBan

func (_c *WotoClient) AddGBan(info interfaces.GbanInfo) error

func (*WotoClient) AddHPat

func (_c *WotoClient) AddHPat(patID string, t int32) (wa.RESULT, []bson.M)

AddPat will add a new hentai pat to the db. it's not our duty to check if the patID already exists or not! pat plugin should check if before call this method!

func (*WotoClient) AddPat

func (_c *WotoClient) AddPat(patID string, t int32) (wa.RESULT, []bson.M)

AddPat will add a new pat to the db. it's not our duty to check if the patID already exists or not! pat plugin should check if before call this method!

func (*WotoClient) AddPat2

func (_c *WotoClient) AddPat2(patID string, t int32) (wa.RESULT, []bson.M)

AddPat will add a new pat to the db. it's not our duty to check if the patID already exists or not! pat plugin should check if before call this method!

func (*WotoClient) AddSudo

func (_c *WotoClient) AddSudo(id int64, nick string) wa.RESULT

func (*WotoClient) CreateNewAccount

func (_c *WotoClient) CreateNewAccount() wa.RESULT

func (*WotoClient) CreateNewConfiguration

func (_c *WotoClient) CreateNewConfiguration() wa.RESULT

func (*WotoClient) DeleteAccount

func (_c *WotoClient) DeleteAccount() wa.RESULT

func (*WotoClient) DeleteCollection

func (_c *WotoClient) DeleteCollection(database dbTypes.DATABASE,
	collection dbTypes.COLLECTION) wa.RESULT

DeleteCollection will delete the specified collection.

func (*WotoClient) Destroy

func (_c *WotoClient) Destroy()

func (*WotoClient) FindAccount

func (_c *WotoClient) FindAccount(_username, _pass *string) wa.RESULT

func (*WotoClient) GetHPatList

func (_c *WotoClient) GetHPatList() (wa.RESULT, []bson.M)

GetHPatList will give you the hentai pat list in the db. Even if there is no pat in the db, `[]bson.M` will not be nil, though its length will be zero.

func (*WotoClient) GetPatList

func (_c *WotoClient) GetPatList() (wa.RESULT, []bson.M)

GetHPatList will give you the pat list in the db. Even if there is no pat in the db, `[]bson.M` will not be nil, though its length will be zero.

func (*WotoClient) GetPatList2

func (_c *WotoClient) GetPatList2() (wa.RESULT, []bson.M)

GetHPatList will give you the pat list in the db. Even if there is no pat in the db, `[]bson.M` will not be nil, though its length will be zero.

func (*WotoClient) GetWotoConfiguration

func (_c *WotoClient) GetWotoConfiguration() wa.RESULT

GetWotoConfiguration will directly give you the configuration from db.

func (*WotoClient) PingClientDB

func (_c *WotoClient) PingClientDB(_report bool)

func (*WotoClient) RemGBan

func (_c *WotoClient) RemGBan(id int64, sudo int64, nick string) wa.RESULT

func (*WotoClient) RemSudo

func (_c *WotoClient) RemSudo(id int64) wa.RESULT

func (*WotoClient) RemoveHPat

func (_c *WotoClient) RemoveHPat(patID string) (wa.RESULT, []bson.M)

RemoveHPat will remove the hentai pat with specified id. It will return `FAILED` if it encouners any error, will return `SUCCESS` if it successfully deleted the pat and the call to getPatList was successful, and will return `CANCELED` if it found nothing in loop. It's not that it will give you information about existing of a pat! so be carefull about it; the pat MAY EXISTS in the db, but the method may return `CANCELED`.

func (*WotoClient) RemovePat

func (_c *WotoClient) RemovePat(patID string) (wa.RESULT, []bson.M)

RemovePat will remove the pat with specified id. It will return `FAILED` if it encouners any error, will return `SUCCESS` if it successfully deleted the pat and the call to getPatList was successful, and will return `CANCELED` if it found nothing in loop. It's not that it will give you information about existing of a pat! so be carefull about it; the pat MAY EXISTS in the db, but the method may return `CANCELED`.

func (*WotoClient) RemovePat2

func (_c *WotoClient) RemovePat2(patID string) (wa.RESULT, []bson.M)

RemovePat will remove the pat with specified id. It will return `FAILED` if it encouners any error, will return `SUCCESS` if it successfully deleted the pat and the call to getPatList was successful, and will return `CANCELED` if it found nothing in loop. It's not that it will give you information about existing of a pat! so be carefull about it; the pat MAY EXISTS in the db, but the method may return `CANCELED`.

func (*WotoClient) ResetUsersCollection

func (_c *WotoClient) ResetUsersCollection() wa.RESULT

func (*WotoClient) ResetWotoConfiguration

func (_c *WotoClient) ResetWotoConfiguration() wa.RESULT

func (*WotoClient) UpdateAccount

func (_c *WotoClient) UpdateAccount() wa.RESULT

func (*WotoClient) UpdateAccountOnlineToken

func (_c *WotoClient) UpdateAccountOnlineToken() wa.RESULT

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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