Documentation ¶
Index ¶
- Constants
- type GormQueryRepository
- func (r *GormQueryRepository) CheckExists(ctx context.Context, id uuid.UUID) error
- func (r *GormQueryRepository) Create(ctx context.Context, q *Query) error
- func (r *GormQueryRepository) Delete(ctx context.Context, ID uuid.UUID) error
- func (r *GormQueryRepository) List(ctx context.Context, spaceID uuid.UUID) ([]Query, error)
- func (r *GormQueryRepository) ListByCreator(ctx context.Context, spaceID uuid.UUID, creatorID uuid.UUID) ([]Query, error)
- func (r *GormQueryRepository) Load(ctx context.Context, ID uuid.UUID, spaceID uuid.UUID) (*Query, error)
- type Query
- type Repository
Constants ¶
View Source
const APIStringTypeQuery = "queries"
APIStringTypeQuery helps to avoid string literal
View Source
const QueryTableName = "queries"
QueryTableName constant that holds table name of Queries
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormQueryRepository ¶
type GormQueryRepository struct {
// contains filtered or unexported fields
}
GormQueryRepository is the implementation of the storage interface for Queries.
func (*GormQueryRepository) CheckExists ¶
CheckExists returns nil if the given ID exists otherwise returns an error
func (*GormQueryRepository) Create ¶
func (r *GormQueryRepository) Create(ctx context.Context, q *Query) error
Create a new query
func (*GormQueryRepository) Delete ¶
Delete deletes the query with the given id, returns NotFoundError or InternalError
type Query ¶
type Query struct { gormsupport.Lifecycle ID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key"` // This is the ID PK field SpaceID uuid.UUID `sql:"type:uuid"` Creator uuid.UUID `sql:"type:uuid"` Title string Fields string }
Query describes a single Query
func (Query) GetETagData ¶
func (q Query) GetETagData() []interface{}
GetETagData returns the field values to use to generate the ETag
func (Query) GetLastModified ¶
GetLastModified returns the last modification time
type Repository ¶
type Repository interface { repository.Exister Create(ctx context.Context, u *Query) error List(ctx context.Context, spaceID uuid.UUID) ([]Query, error) ListByCreator(ctx context.Context, spaceID uuid.UUID, creatorID uuid.UUID) ([]Query, error) Load(ctx context.Context, queryID uuid.UUID, spaceID uuid.UUID) (*Query, error) Delete(ctx context.Context, ID uuid.UUID) error }
Repository describes interactions with Queries.
func NewQueryRepository ¶
func NewQueryRepository(db *gorm.DB) Repository
NewQueryRepository creates a new storage type.
Directories ¶
Path | Synopsis |
---|---|
Package query This package implements a super basic parser that takes a string, converts it to json and constructs an AndExpression of "key == value" expressions of all the fields in the json object this is just a stand-in until we have defined a proper query language
|
Package query This package implements a super basic parser that takes a string, converts it to json and constructs an AndExpression of "key == value" expressions of all the fields in the json object this is just a stand-in until we have defined a proper query language |
Click to show internal directories.
Click to hide internal directories.