Documentation ¶
Index ¶
- type CallDatabase
- type CivilianDatabase
- type ClientHelper
- type CollectionHelper
- type CommunityDatabase
- type CursorHelper
- type DatabaseHelper
- type EmsDatabase
- type EmsVehicleDatabase
- type FirearmDatabase
- type LicenseDatabase
- type SingleResultHelper
- type UserDatabase
- type VehicleDatabase
- type WarrantDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallDatabase ¶
type CallDatabase interface { FindOne(context.Context, interface{}, ...*options.FindOneOptions) (*models.Call, error) Find(context.Context, interface{}, ...*options.FindOptions) ([]models.Call, error) }
CallDatabase contains the methods to use with the call database
func NewCallDatabase ¶
func NewCallDatabase(db DatabaseHelper) CallDatabase
NewCallDatabase initializes a new instance of user database with the provided db connection
type CivilianDatabase ¶
type CivilianDatabase interface { FindOne(context.Context, interface{}, ...*options.FindOneOptions) (*models.Civilian, error) Find(context.Context, interface{}, ...*options.FindOptions) ([]models.Civilian, error) }
CivilianDatabase contains the methods to use with the civilian database
func NewCivilianDatabase ¶
func NewCivilianDatabase(db DatabaseHelper) CivilianDatabase
NewCivilianDatabase initializes a new instance of user database with the provided db connection
type ClientHelper ¶
type ClientHelper interface { Database(string) DatabaseHelper Connect() error StartSession() (mongo.Session, error) }
ClientHelper defined to help at client creation inside main.go
type CollectionHelper ¶
type CollectionHelper interface { FindOne(context.Context, interface{}, ...*options.FindOneOptions) SingleResultHelper Find(context.Context, interface{}, ...*options.FindOptions) CursorHelper }
CollectionHelper contains all the methods defined for collections in this project
type CommunityDatabase ¶
type CommunityDatabase interface { FindOne(ctx context.Context, filter interface{}) (*models.Community, error) Find(ctx context.Context, filter interface{}) ([]models.Community, error) }
CommunityDatabase contains the methods to use with the community database
func NewCommunityDatabase ¶
func NewCommunityDatabase(db DatabaseHelper) CommunityDatabase
NewCommunityDatabase initializes a new instance of community database with the provided db connection
type CursorHelper ¶
type CursorHelper interface {
Decode(v interface{}) error
}
CursorHelper contains a method to decode the cursor
type DatabaseHelper ¶
type DatabaseHelper interface { Collection(name string) CollectionHelper Client() ClientHelper }
DatabaseHelper contains the collection and client to be used to access the methods defined below
func NewDatabase ¶
func NewDatabase(conf *config.Config, client ClientHelper) DatabaseHelper
NewDatabase uses the client from NewClient and sets the database name
type EmsDatabase ¶
type EmsDatabase interface { FindOne(context.Context, interface{}, ...*options.FindOneOptions) (*models.Ems, error) Find(context.Context, interface{}, ...*options.FindOptions) ([]models.Ems, error) }
EmsDatabase contains the methods to use with the ems database
func NewEmsDatabase ¶
func NewEmsDatabase(db DatabaseHelper) EmsDatabase
NewEmsDatabase initializes a new instance of user database with the provided db connection
type EmsVehicleDatabase ¶
type EmsVehicleDatabase interface { FindOne(context.Context, interface{}, ...*options.FindOneOptions) (*models.EmsVehicle, error) Find(context.Context, interface{}, ...*options.FindOptions) ([]models.EmsVehicle, error) }
EmsVehicleDatabase contains the methods to use with the emsVehicle database
func NewEmsVehicleDatabase ¶
func NewEmsVehicleDatabase(db DatabaseHelper) EmsVehicleDatabase
NewEmsVehicleDatabase initializes a new instance of user database with the provided db connection
type FirearmDatabase ¶
type FirearmDatabase interface { FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) (*models.Firearm, error) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) ([]models.Firearm, error) }
FirearmDatabase contains the methods to use with the firearm database
func NewFirearmDatabase ¶
func NewFirearmDatabase(db DatabaseHelper) FirearmDatabase
NewFirearmDatabase initializes a new instance of firearm database with the provided db connection
type LicenseDatabase ¶ added in v1.8.0
type LicenseDatabase interface { FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) (*models.License, error) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) ([]models.License, error) }
LicenseDatabase contains the methods to use with the license database
func NewLicenseDatabase ¶ added in v1.8.0
func NewLicenseDatabase(db DatabaseHelper) LicenseDatabase
NewLicenseDatabase initializes a new instance of license database with the provided db connection
type SingleResultHelper ¶
type SingleResultHelper interface {
Decode(v interface{}) error
}
SingleResultHelper contains a single method to decode the result
type UserDatabase ¶
type UserDatabase interface { FindOne(ctx context.Context, filter interface{}) (*models.User, error) Find(ctx context.Context, filter interface{}) ([]models.User, error) }
UserDatabase contains the methods to use with the user database
func NewUserDatabase ¶
func NewUserDatabase(db DatabaseHelper) UserDatabase
NewUserDatabase initializes a new instance of user database with the provided db connection
type VehicleDatabase ¶
type VehicleDatabase interface { FindOne(context.Context, interface{}, ...*options.FindOneOptions) (*models.Vehicle, error) Find(context.Context, interface{}, ...*options.FindOptions) ([]models.Vehicle, error) }
VehicleDatabase contains the methods to use with the vehicle database
func NewVehicleDatabase ¶
func NewVehicleDatabase(db DatabaseHelper) VehicleDatabase
NewVehicleDatabase initializes a new instance of user database with the provided db connection
type WarrantDatabase ¶ added in v1.8.0
type WarrantDatabase interface { FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) (*models.Warrant, error) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) ([]models.Warrant, error) }
WarrantDatabase contains the methods to use with the warrant database
func NewWarrantDatabase ¶ added in v1.8.0
func NewWarrantDatabase(db DatabaseHelper) WarrantDatabase
NewWarrantDatabase initializes a new instance of warrant database with the provided db connection