Documentation
¶
Overview ¶
Package logs contains the sqlite database schema
Index ¶
- Variables
- type DeleteLogByIdParams
- type DeleteLogLevelByIdParams
- type DeleteNotificationByIdParams
- type DeleteRequestByIdParams
- type DeleteResponseByIdParams
- type ErrWrite
- type GetLogByIdParams
- type GetLogLevelByNameParams
- type GetLogsByNotificationIdParams
- type GetLogsByRequestIdParams
- type GetLogsByResponseIdParams
- type GetNotificationByIdParams
- type GetNotificationsByMethodParams
- type GetRequestByIdParams
- type GetRequestsByMethodParams
- type GetResponseByIdParams
- type GetResponsesByRpcIdParams
- type InsertLogLevelParams
- type InsertLogParams
- type InsertNotificationParams
- type InsertRequestParams
- type InsertResponseParams
- type Log
- type LogLevel
- type Notification
- type Prime
- type Queries
- func (q *Queries) DeleteLogById(ctx context.Context, arg DeleteLogByIdParams) error
- func (q *Queries) DeleteLogLevelById(ctx context.Context, arg DeleteLogLevelByIdParams) error
- func (q *Queries) DeleteNotificationById(ctx context.Context, arg DeleteNotificationByIdParams) error
- func (q *Queries) DeleteRequestById(ctx context.Context, arg DeleteRequestByIdParams) error
- func (q *Queries) DeleteResponseById(ctx context.Context, arg DeleteResponseByIdParams) error
- func (q *Queries) GetLogById(ctx context.Context, arg GetLogByIdParams) (*Log, error)
- func (q *Queries) GetLogLevelByName(ctx context.Context, arg GetLogLevelByNameParams) (*LogLevel, error)
- func (q *Queries) GetLogsByNotificationId(ctx context.Context, arg GetLogsByNotificationIdParams) ([]*Log, error)
- func (q *Queries) GetLogsByRequestId(ctx context.Context, arg GetLogsByRequestIdParams) ([]*Log, error)
- func (q *Queries) GetLogsByResponseId(ctx context.Context, arg GetLogsByResponseIdParams) ([]*Log, error)
- func (q *Queries) GetNotificationById(ctx context.Context, arg GetNotificationByIdParams) (*Notification, error)
- func (q *Queries) GetNotificationsByMethod(ctx context.Context, arg GetNotificationsByMethodParams) ([]*Notification, error)
- func (q *Queries) GetRequestById(ctx context.Context, arg GetRequestByIdParams) (*Request, error)
- func (q *Queries) GetRequestsByMethod(ctx context.Context, arg GetRequestsByMethodParams) ([]*Request, error)
- func (q *Queries) GetResponseById(ctx context.Context, arg GetResponseByIdParams) (*Response, error)
- func (q *Queries) GetResponsesByRpcId(ctx context.Context, arg GetResponsesByRpcIdParams) ([]*Response, error)
- func (q *Queries) InsertLog(ctx context.Context, arg InsertLogParams) (*Log, error)
- func (q *Queries) InsertLogLevel(ctx context.Context, arg InsertLogLevelParams) (*LogLevel, error)
- func (q *Queries) InsertNotification(ctx context.Context, arg InsertNotificationParams) (*Notification, error)
- func (q *Queries) InsertRequest(ctx context.Context, arg InsertRequestParams) (*Request, error)
- func (q *Queries) InsertResponse(ctx context.Context, arg InsertResponseParams) (*Response, error)
- func (q *Queries) UpdateLogById(ctx context.Context, arg UpdateLogByIdParams) (*Log, error)
- func (q *Queries) UpdateLogLevelById(ctx context.Context, arg UpdateLogLevelByIdParams) (*LogLevel, error)
- func (q *Queries) UpdateNotificationById(ctx context.Context, arg UpdateNotificationByIdParams) (*Notification, error)
- func (q *Queries) UpdateRequestById(ctx context.Context, arg UpdateRequestByIdParams) (*Request, error)
- func (q *Queries) UpdateResponseById(ctx context.Context, arg UpdateResponseByIdParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- func (q *Queries) Write(p []byte) (n int, err error)
- type Request
- type Response
- type UpdateLogByIdParams
- type UpdateLogLevelByIdParams
- type UpdateNotificationByIdParams
- type UpdateRequestByIdParams
- type UpdateResponseByIdParams
Constants ¶
This section is empty.
Variables ¶
var MasterSchema string
MasterSchema is the schema for the main database
Functions ¶
This section is empty.
Types ¶
type DeleteLogByIdParams ¶
type DeleteLogByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type DeleteLogLevelByIdParams ¶
type DeleteLogLevelByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type DeleteNotificationByIdParams ¶
type DeleteNotificationByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type DeleteRequestByIdParams ¶
type DeleteRequestByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type DeleteResponseByIdParams ¶
type DeleteResponseByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type ErrWrite ¶
type ErrWrite struct {
Message string
}
ErrWrite is an error for when the write fails
type GetLogByIdParams ¶
type GetLogByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type GetLogLevelByNameParams ¶
type GetLogLevelByNameParams struct {
Name string `db:"name" json:"name"`
}
type GetLogsByNotificationIdParams ¶
type GetLogsByNotificationIdParams struct {
NotificationID *int64 `db:"notification_id" json:"notification_id"`
}
type GetLogsByRequestIdParams ¶
type GetLogsByRequestIdParams struct {
RequestID *int64 `db:"request_id" json:"request_id"`
}
type GetLogsByResponseIdParams ¶
type GetLogsByResponseIdParams struct {
ResponseID *int64 `db:"response_id" json:"response_id"`
}
type GetNotificationByIdParams ¶
type GetNotificationByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type GetNotificationsByMethodParams ¶
type GetNotificationsByMethodParams struct {
Method string `db:"method" json:"method"`
}
type GetRequestByIdParams ¶
type GetRequestByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type GetRequestsByMethodParams ¶
type GetRequestsByMethodParams struct {
RpcMethod string `db:"rpc_method" json:"rpc_method"`
}
type GetResponseByIdParams ¶
type GetResponseByIdParams struct {
ID int64 `db:"id" json:"id"`
}
type GetResponsesByRpcIdParams ¶
type GetResponsesByRpcIdParams struct {
RpcID int64 `db:"rpc_id" json:"rpc_id"`
}
type InsertLogLevelParams ¶
type InsertLogLevelParams struct {
Name string `db:"name" json:"name"`
}
type InsertLogParams ¶
type InsertNotificationParams ¶
type InsertNotificationParams struct {
Method string `db:"method" json:"method"`
}
type InsertRequestParams ¶
type InsertResponseParams ¶
type Log ¶
type Log struct { ID int64 `db:"id" json:"id"` Value string `db:"value" json:"value"` CreatedAt *time.Time `db:"created_at" json:"created_at"` RequestID *int64 `db:"request_id" json:"request_id"` ResponseID *int64 `db:"response_id" json:"response_id"` NotificationID *int64 `db:"notification_id" json:"notification_id"` }
type Notification ¶
type Prime ¶
type Prime struct { Log Log `json:"log"` LogLevel LogLevel `json:"log_level"` Notification Notification `json:"notification,omitempty"` Request Request `json:"request,omitempty"` Response Response `json:"response,omitempty"` }
Prime is the prime for the logs table
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
Queries is the object to use to interact with the database.
func (*Queries) DeleteLogById ¶
func (q *Queries) DeleteLogById(ctx context.Context, arg DeleteLogByIdParams) error
DeleteLogById
DELETE FROM logs WHERE id = ?
func (*Queries) DeleteLogLevelById ¶
func (q *Queries) DeleteLogLevelById(ctx context.Context, arg DeleteLogLevelByIdParams) error
DeleteLogLevelById
DELETE FROM log_levels WHERE id = ?
func (*Queries) DeleteNotificationById ¶
func (q *Queries) DeleteNotificationById(ctx context.Context, arg DeleteNotificationByIdParams) error
DeleteNotificationById
DELETE FROM notifications WHERE id = ?
func (*Queries) DeleteRequestById ¶
func (q *Queries) DeleteRequestById(ctx context.Context, arg DeleteRequestByIdParams) error
DeleteRequestById
DELETE FROM requests WHERE id = ?
func (*Queries) DeleteResponseById ¶
func (q *Queries) DeleteResponseById(ctx context.Context, arg DeleteResponseByIdParams) error
DeleteResponseById
DELETE FROM responses WHERE id = ?
func (*Queries) GetLogById ¶
****************************************************************************
SELECT id, value, created_at, request_id, response_id, notification_id FROM logs WHERE id = ?
func (*Queries) GetLogLevelByName ¶
func (q *Queries) GetLogLevelByName(ctx context.Context, arg GetLogLevelByNameParams) (*LogLevel, error)
GetLogLevelByName
SELECT id, name FROM log_levels WHERE name = ?
func (*Queries) GetLogsByNotificationId ¶
func (q *Queries) GetLogsByNotificationId(ctx context.Context, arg GetLogsByNotificationIdParams) ([]*Log, error)
GetLogsByNotificationId
SELECT id, value, created_at, request_id, response_id, notification_id FROM logs WHERE notification_id = ?
func (*Queries) GetLogsByRequestId ¶
func (q *Queries) GetLogsByRequestId(ctx context.Context, arg GetLogsByRequestIdParams) ([]*Log, error)
GetLogsByRequestId
SELECT id, value, created_at, request_id, response_id, notification_id FROM logs WHERE request_id = ?
func (*Queries) GetLogsByResponseId ¶
func (q *Queries) GetLogsByResponseId(ctx context.Context, arg GetLogsByResponseIdParams) ([]*Log, error)
GetLogsByResponseId
SELECT id, value, created_at, request_id, response_id, notification_id FROM logs WHERE response_id = ?
func (*Queries) GetNotificationById ¶
func (q *Queries) GetNotificationById(ctx context.Context, arg GetNotificationByIdParams) (*Notification, error)
****************************************************************************
SELECT id, method, created_at, updated_at FROM notifications WHERE id = ?
func (*Queries) GetNotificationsByMethod ¶
func (q *Queries) GetNotificationsByMethod(ctx context.Context, arg GetNotificationsByMethodParams) ([]*Notification, error)
GetNotificationsByMethod
SELECT id, method, created_at, updated_at FROM notifications WHERE method = ?
func (*Queries) GetRequestById ¶
****************************************************************************
SELECT id, rpc_method, rpc_id FROM requests WHERE id = ?
func (*Queries) GetRequestsByMethod ¶
func (q *Queries) GetRequestsByMethod(ctx context.Context, arg GetRequestsByMethodParams) ([]*Request, error)
GetRequestsByMethod
SELECT id, rpc_method, rpc_id FROM requests WHERE rpc_method = ?
func (*Queries) GetResponseById ¶
func (q *Queries) GetResponseById(ctx context.Context, arg GetResponseByIdParams) (*Response, error)
****************************************************************************
SELECT id, rpc, rpc_id, result, error, created_at FROM responses WHERE id = ?
func (*Queries) GetResponsesByRpcId ¶
func (q *Queries) GetResponsesByRpcId(ctx context.Context, arg GetResponsesByRpcIdParams) ([]*Response, error)
GetResponsesByRpcId
SELECT id, rpc, rpc_id, result, error, created_at FROM responses WHERE rpc_id = ?
func (*Queries) InsertLog ¶
InsertLog
INSERT INTO logs (value, request_id, response_id, notification_id) VALUES (?, ?, ?, ?) RETURNING id, value, created_at, request_id, response_id, notification_id
func (*Queries) InsertLogLevel ¶
InsertLogLevel
INSERT INTO log_levels (name) VALUES (?) RETURNING id, name
func (*Queries) InsertNotification ¶
func (q *Queries) InsertNotification(ctx context.Context, arg InsertNotificationParams) (*Notification, error)
InsertNotification
INSERT INTO notifications (method) VALUES (?) RETURNING id, method, created_at, updated_at
func (*Queries) InsertRequest ¶
InsertRequest
INSERT INTO requests (rpc_method, rpc_id) VALUES (?, ?) RETURNING id, rpc_method, rpc_id
func (*Queries) InsertResponse ¶
InsertResponse
INSERT INTO responses (rpc, rpc_id, result, error) VALUES (?, ?, ?, ?) RETURNING id, rpc, rpc_id, result, error, created_at
func (*Queries) UpdateLogById ¶
UpdateLogById
UPDATE logs SET value = ?, request_id = ?, response_id = ?, notification_id = ? WHERE id = ? RETURNING id, value, created_at, request_id, response_id, notification_id
func (*Queries) UpdateLogLevelById ¶
func (q *Queries) UpdateLogLevelById(ctx context.Context, arg UpdateLogLevelByIdParams) (*LogLevel, error)
UpdateLogLevelById
UPDATE log_levels SET name = ? WHERE id = ? RETURNING id, name
func (*Queries) UpdateNotificationById ¶
func (q *Queries) UpdateNotificationById(ctx context.Context, arg UpdateNotificationByIdParams) (*Notification, error)
UpdateNotificationById
UPDATE notifications SET method = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? RETURNING id, method, created_at, updated_at
func (*Queries) UpdateRequestById ¶
func (q *Queries) UpdateRequestById(ctx context.Context, arg UpdateRequestByIdParams) (*Request, error)
UpdateRequestById
UPDATE requests SET rpc_method = ?, rpc_id = ? WHERE id = ? RETURNING id, rpc_method, rpc_id
func (*Queries) UpdateResponseById ¶
func (q *Queries) UpdateResponseById(ctx context.Context, arg UpdateResponseByIdParams) error
UpdateResponseById
UPDATE responses SET rpc = ?, rpc_id = ?, result = ?, error = ? WHERE id = ?