sqlite

package
v0.0.0-...-c34cdf8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BusConnector

type BusConnector struct {
	DB *sql.DB
}

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

type IdentityConnector struct {
	DB *sql.DB
}

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

Jump to

Keyboard shortcuts

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