Documentation
¶
Overview ¶
Package postgres implements the storage interface for PostgreSQL. internal/storage/postgres/client.go
Package postgres implements database migrations for PostgreSQL. internal/storage/postgres/migrations.go
Index ¶
- func RunMigrations(db *sql.DB) error
- type Client
- func (c *Client) Close() error
- func (c *Client) DeleteServer(id string) error
- func (c *Client) GetServerByID(id string) (*models.Server, error)
- func (c *Client) Init() error
- func (c *Client) QueryConnections(filter interface{}) ([]*models.ConnectionLog, error)
- func (c *Client) QueryRequestLogs(filter interface{}) ([]*models.RequestLog, error)
- func (c *Client) QueryServers(filter interface{}) ([]*models.Server, error)
- func (c *Client) QueryTraffic(filter interface{}) ([]*models.TrafficStats, error)
- func (c *Client) SaveConnection(conn *models.ConnectionLog) error
- func (c *Client) SaveRequestLog(log *models.RequestLog) error
- func (c *Client) SaveServer(server *models.Server) error
- func (c *Client) SaveTraffic(stats *models.TrafficStats) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMigrations ¶
RunMigrations applies database migrations for PostgreSQL.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the Storage interface for PostgreSQL.
func (*Client) DeleteServer ¶
DeleteServer deletes a server configuration by ID.
func (*Client) GetServerByID ¶
GetServerByID retrieves a server configuration by ID.
func (*Client) QueryConnections ¶
func (c *Client) QueryConnections(filter interface{}) ([]*models.ConnectionLog, error)
QueryConnections queries connection logs.
func (*Client) QueryRequestLogs ¶
func (c *Client) QueryRequestLogs(filter interface{}) ([]*models.RequestLog, error)
QueryRequestLogs queries request logs.
func (*Client) QueryServers ¶
QueryServers queries server configurations.
func (*Client) QueryTraffic ¶
func (c *Client) QueryTraffic(filter interface{}) ([]*models.TrafficStats, error)
QueryTraffic queries traffic statistics.
func (*Client) SaveConnection ¶
func (c *Client) SaveConnection(conn *models.ConnectionLog) error
SaveConnection saves a connection log.
func (*Client) SaveRequestLog ¶
func (c *Client) SaveRequestLog(log *models.RequestLog) error
SaveRequestLog saves a request log.
func (*Client) SaveServer ¶
SaveServer saves a server configuration.
func (*Client) SaveTraffic ¶
func (c *Client) SaveTraffic(stats *models.TrafficStats) error
SaveTraffic saves traffic statistics.