Documentation
¶
Index ¶
- type CreateNewRequestParams
- type CreateUserParams
- type DBTX
- type Endpoint
- type FileAttachment
- type GetEndpointHistoryParams
- type GetEndpointHistoryRow
- type GetEndpointRequestCountRow
- type HttpMethod
- type InsertEndpointParams
- type InsertFreeEndpointParams
- type ListUsersParams
- type NullHttpMethod
- type NullPlan
- type Plan
- type Querier
- type Queries
- func (q *Queries) CheckEndpointExists(ctx context.Context, endpoint string) (bool, error)
- func (q *Queries) CreateNewRequest(ctx context.Context, arg CreateNewRequestParams) (Request, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteExpiredRequests(ctx context.Context) error
- func (q *Queries) DeleteUser(ctx context.Context, id int64) error
- func (q *Queries) GetEndpointDetails(ctx context.Context, endpoint string) (Endpoint, error)
- func (q *Queries) GetEndpointHistory(ctx context.Context, arg GetEndpointHistoryParams) ([]GetEndpointHistoryRow, error)
- func (q *Queries) GetEndpointRequestCount(ctx context.Context, endpoint string) (GetEndpointRequestCountRow, error)
- func (q *Queries) GetNonExpiredEndpointsOfUser(ctx context.Context, userID pgtype.Int8) ([]Endpoint, error)
- func (q *Queries) GetRequestById(ctx context.Context, id int64) (Request, error)
- func (q *Queries) GetRequestByUUID(ctx context.Context, uuid string) (Request, error)
- func (q *Queries) GetUser(ctx context.Context, id int64) (User, error)
- func (q *Queries) GetUserEndpoints(ctx context.Context, userID pgtype.Int8) ([]Endpoint, error)
- func (q *Queries) GetUserFromEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) GetUserFromUsername(ctx context.Context, username string) (User, error)
- func (q *Queries) InsertEndpoint(ctx context.Context, arg InsertEndpointParams) (Endpoint, error)
- func (q *Queries) InsertFreeEndpoint(ctx context.Context, arg InsertFreeEndpointParams) (Endpoint, error)
- func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Request
- type Response
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateNewRequestParams ¶
type CreateNewRequestParams struct { UserID pgtype.Int8 `json:"user_id"` EndpointID int64 `json:"endpoint_id"` Path string `json:"path"` FormData []byte `json:"form_data"` ContentType string `json:"content_type"` ResponseID pgtype.Int8 `json:"response_id"` Content pgtype.Text `json:"content"` Method HttpMethod `json:"method"` Uuid string `json:"uuid"` SourceIp string `json:"source_ip"` ContentSize int32 `json:"content_size"` ResponseCode pgtype.Int4 `json:"response_code"` Headers []byte `json:"headers"` QueryParams []byte `json:"query_params"` ExpiresAt pgtype.Timestamptz `json:"expires_at"` }
type CreateUserParams ¶
type FileAttachment ¶
type GetEndpointHistoryRow ¶
type GetEndpointHistoryRow struct { ID int64 `json:"id"` Uuid string `json:"uuid"` UserID pgtype.Int8 `json:"user_id"` Plan Plan `json:"plan"` Path string `json:"path"` ResponseID pgtype.Int8 `json:"response_id"` ResponseCode pgtype.Int4 `json:"response_code"` FormData []byte `json:"form_data"` ContentType string `json:"content_type"` Content pgtype.Text `json:"content"` Method HttpMethod `json:"method"` SourceIp string `json:"source_ip"` ContentSize int32 `json:"content_size"` Headers []byte `json:"headers"` QueryParams []byte `json:"query_params"` CreatedAt pgtype.Timestamptz `json:"created_at"` ExpiresAt pgtype.Timestamptz `json:"expires_at"` Endpoint pgtype.Text `json:"endpoint"` }
type HttpMethod ¶
type HttpMethod string
const ( HttpMethodGet HttpMethod = "get" HttpMethodPost HttpMethod = "post" HttpMethodPut HttpMethod = "put" HttpMethodPatch HttpMethod = "patch" HttpMethodDelete HttpMethod = "delete" HttpMethodOptions HttpMethod = "options" HttpMethodHead HttpMethod = "head" HttpMethodTrace HttpMethod = "trace" HttpMethodConnect HttpMethod = "connect" )
func (*HttpMethod) Scan ¶
func (e *HttpMethod) Scan(src interface{}) error
type InsertEndpointParams ¶
type InsertFreeEndpointParams ¶
type InsertFreeEndpointParams struct { Endpoint string `json:"endpoint"` UserID pgtype.Int8 `json:"user_id"` ExpiresAt pgtype.Timestamptz `json:"expires_at"` }
type ListUsersParams ¶
type NullHttpMethod ¶
type NullHttpMethod struct { HttpMethod HttpMethod `json:"http_method"` Valid bool `json:"valid"` // Valid is true if HttpMethod is not NULL }
func (*NullHttpMethod) Scan ¶
func (ns *NullHttpMethod) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPlan ¶
type NullPlan struct { Plan Plan `json:"plan"` Valid bool `json:"valid"` // Valid is true if Plan is not NULL }
type Querier ¶
type Querier interface { CheckEndpointExists(ctx context.Context, endpoint string) (bool, error) CreateNewRequest(ctx context.Context, arg CreateNewRequestParams) (Request, error) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) DeleteExpiredRequests(ctx context.Context) error DeleteUser(ctx context.Context, id int64) error GetEndpointDetails(ctx context.Context, endpoint string) (Endpoint, error) GetEndpointHistory(ctx context.Context, arg GetEndpointHistoryParams) ([]GetEndpointHistoryRow, error) GetEndpointRequestCount(ctx context.Context, endpoint string) (GetEndpointRequestCountRow, error) GetNonExpiredEndpointsOfUser(ctx context.Context, userID pgtype.Int8) ([]Endpoint, error) GetRequestById(ctx context.Context, id int64) (Request, error) GetRequestByUUID(ctx context.Context, uuid string) (Request, error) GetUser(ctx context.Context, id int64) (User, error) GetUserEndpoints(ctx context.Context, userID pgtype.Int8) ([]Endpoint, error) GetUserFromEmail(ctx context.Context, email string) (User, error) GetUserFromUsername(ctx context.Context, username string) (User, error) InsertEndpoint(ctx context.Context, arg InsertEndpointParams) (Endpoint, error) InsertFreeEndpoint(ctx context.Context, arg InsertFreeEndpointParams) (Endpoint, error) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CheckEndpointExists ¶
func (*Queries) CreateNewRequest ¶
func (*Queries) CreateUser ¶
func (*Queries) DeleteExpiredRequests ¶
func (*Queries) GetEndpointDetails ¶
func (*Queries) GetEndpointHistory ¶
func (q *Queries) GetEndpointHistory(ctx context.Context, arg GetEndpointHistoryParams) ([]GetEndpointHistoryRow, error)
func (*Queries) GetEndpointRequestCount ¶
func (*Queries) GetNonExpiredEndpointsOfUser ¶
func (*Queries) GetRequestById ¶
func (*Queries) GetRequestByUUID ¶
func (*Queries) GetUserEndpoints ¶
func (*Queries) GetUserFromEmail ¶
func (*Queries) GetUserFromUsername ¶
func (*Queries) InsertEndpoint ¶
func (*Queries) InsertFreeEndpoint ¶
type Request ¶
type Request struct { ID int64 `json:"id"` Uuid string `json:"uuid"` UserID pgtype.Int8 `json:"user_id"` EndpointID int64 `json:"endpoint_id"` Plan Plan `json:"plan"` Path string `json:"path"` ResponseID pgtype.Int8 `json:"response_id"` ResponseTime pgtype.Int4 `json:"response_time"` Content pgtype.Text `json:"content"` ContentType string `json:"content_type"` Method HttpMethod `json:"method"` // IPv4 SourceIp string `json:"source_ip"` ContentSize int32 `json:"content_size"` ResponseCode pgtype.Int4 `json:"response_code"` Headers []byte `json:"headers"` FormData []byte `json:"form_data"` QueryParams []byte `json:"query_params"` CreatedAt pgtype.Timestamptz `json:"created_at"` ExpiresAt pgtype.Timestamptz `json:"expires_at"` IsDeleted pgtype.Bool `json:"is_deleted"` }
Click to show internal directories.
Click to hide internal directories.