Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrPlanNotFound = appError("plan does not exists") ErrUserNotFound = appError("user not found") ErrCounterExhausted = appError("no more units left") )
View Source
const (
ErrURLEndpointNotFound = appError("endpoint not found")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FindURLOptions ¶
type FindUserOptions ¶
type FindUserOptions struct {
SSHKeyFingerprint string
}
type IngestHTTPRequest ¶
type IngestHTTPRequest struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4()" json:"id,omitempty" mapstructure:"id"` UrlID uuid.UUID `json:"url_id,omitempty"` Request RequestDefinition `json:"request,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty" bson:"created_at" mapstructure:"created_at"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty" bson:"updated_at" mapstructure:"updated_at"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty" bson:"deleted_at" mapstructure:"deleted_at"` bun.BaseModel `bun:"table:ingests"` }
type IngestRepository ¶
type IngestRepository interface { Create(context.Context, *IngestHTTPRequest) error Delete(context.Context, *DeleteIngestedRequestOptions) error }
type RequestDefinition ¶
type RequestDefinition struct { Body string `mapstructure:"body" json:"body,omitempty"` Query string `json:"query,omitempty"` Headers http.Header `json:"headers,omitempty"` IPAddress net.IP `json:"ip_address,omitempty" bson:"ip_address"` Size int64 `json:"size,omitempty"` Method string `json:"method,omitempty"` }
type URLEndpoint ¶
type URLEndpoint struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4()" json:"id,omitempty"` Reference string `json:"reference,omitempty"` IsActive bool `json:"is_active,omitempty"` UserID uuid.UUID `json:"user_id,omitempty"` Metadata URLEndpointMetadata `json:"metadata,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty" bson:"created_at"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty" bson:"updated_at"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty" bson:"deleted_at"` bun.BaseModel `bun:"table:urls"` }
func NewURLEndpoint ¶
func NewURLEndpoint(userID uuid.UUID) *URLEndpoint
func (*URLEndpoint) PubChannel ¶
func (u *URLEndpoint) PubChannel() string
type URLEndpointMetadata ¶
type URLEndpointMetadata struct{}
type URLRepository ¶
type URLRepository interface { Create(context.Context, *URLEndpoint) error Get(context.Context, *FindURLOptions) (*URLEndpoint, error) Latest(context.Context, uuid.UUID) (*URLEndpoint, error) }
type User ¶
type User struct { ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4()" json:"id,omitempty"` SSHFingerPrint string `json:"ssh_finger_print,omitempty"` IsBanned bool `json:"is_banned,omitempty"` CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"created_at,omitempty" bson:"created_at"` UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp" json:"updated_at,omitempty" bson:"updated_at"` DeletedAt *time.Time `bun:",soft_delete,nullzero" json:"-,omitempty" bson:"deleted_at"` bun.BaseModel `bun:"table:users"` }
Click to show internal directories.
Click to hide internal directories.