Documentation ¶
Index ¶
- type BusConnector
- func (c *BusConnector) AddStopToLine(lineID, stopID int) error
- func (c *BusConnector) Close() error
- func (c *BusConnector) FindStopsByLocation(lat, lon, radius float64) ([]api.Stop, error)
- func (c *BusConnector) FindStopsByText(text string) ([]api.Stop, error)
- func (c *BusConnector) GetLineByName(name string) (api.Line, error)
- func (c *BusConnector) GetLines() ([]api.Line, error)
- func (c *BusConnector) GetStopByNumber(stopNumber int) (api.Stop, error)
- func (c *BusConnector) GetStops() ([]api.Stop, error)
- func (c *BusConnector) InsertLine(name string) (int64, error)
- func (c *BusConnector) InsertStop(stop api.Stop) (int64, error)
- type IdentityConnector
- func (c *IdentityConnector) Close() error
- func (c *IdentityConnector) DeleteIdentity(id int) error
- func (c *IdentityConnector) GetIdentity(id int) (*api.Identity, error)
- func (c *IdentityConnector) GetUserByUUID(provider, uuid string) (*api.Identity, error)
- func (c *IdentityConnector) InsertIdentity(identity *api.Identity) error
- func (c *IdentityConnector) UpdateIdentity(identity *api.Identity) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusConnector ¶
BusConnector is a struct that holds the database connection
func NewBusConnector ¶
func NewBusConnector() (*BusConnector, error)
NewBusConnector initializes a new database given a path
func (*BusConnector) AddStopToLine ¶
func (c *BusConnector) AddStopToLine(lineID, stopID int) error
AddStopToLine adds a stop to a line in the line_stops table
func (*BusConnector) Close ¶
func (c *BusConnector) Close() error
Close closes the database connection
func (*BusConnector) FindStopsByLocation ¶
func (c *BusConnector) FindStopsByLocation(lat, lon, radius float64) ([]api.Stop, error)
FindStopsByLocation retrieves stops from the stops table within a given radius around a location in meters
func (*BusConnector) FindStopsByText ¶
func (c *BusConnector) FindStopsByText(text string) ([]api.Stop, error)
FindStopsByText retrieves a stop from the stops table by text matching a stop name
func (*BusConnector) GetLineByName ¶
func (c *BusConnector) GetLineByName(name string) (api.Line, error)
GetLineByName retrieves a line from the lines table by name
func (*BusConnector) GetLines ¶
func (c *BusConnector) GetLines() ([]api.Line, error)
GetLines retrieves all lines from the lines table
func (*BusConnector) GetStopByNumber ¶
func (c *BusConnector) GetStopByNumber(stopNumber int) (api.Stop, error)
GetStopByNumber retrieves a stop from the stops table by stop number
func (*BusConnector) GetStops ¶
func (c *BusConnector) GetStops() ([]api.Stop, error)
GetStops retrieves all stops from the stops table
func (*BusConnector) InsertLine ¶
func (c *BusConnector) InsertLine(name string) (int64, error)
InsertLine inserts a new line into the lines table
func (*BusConnector) InsertStop ¶
func (c *BusConnector) InsertStop(stop api.Stop) (int64, error)
InsertStop inserts a new stop into the stops table
type IdentityConnector ¶
func NewIdentityConnector ¶
func NewIdentityConnector() (*IdentityConnector, error)
NewIdentityConnector creates a new IdentityConnector and initializes the database
func (*IdentityConnector) Close ¶
func (c *IdentityConnector) Close() error
Close closes the database connection
func (*IdentityConnector) DeleteIdentity ¶
func (c *IdentityConnector) DeleteIdentity(id int) error
DeleteIdentity deletes an identity by ID
func (*IdentityConnector) GetIdentity ¶
func (c *IdentityConnector) GetIdentity(id int) (*api.Identity, error)
GetIdentity retrieves an identity by ID
func (*IdentityConnector) GetUserByUUID ¶
func (c *IdentityConnector) GetUserByUUID(provider, uuid string) (*api.Identity, error)
GetUserByUUID retrieves an identity by UUID and provider
func (*IdentityConnector) InsertIdentity ¶
func (c *IdentityConnector) InsertIdentity(identity *api.Identity) error
InsertIdentity inserts a new identity into the database
func (*IdentityConnector) UpdateIdentity ¶
func (c *IdentityConnector) UpdateIdentity(identity *api.Identity) error
UpdateIdentity updates an existing identity in the database