Documentation
¶
Index ¶
- Variables
- func ExtractValueFromJSONPath(jpq string) ([]interface{}, error)
- func FilterQuery(queryFor model.LabelableObject, setCombination SetCombination, ...) (string, []interface{}, error)
- func FilterQueryGlobal(queryFor model.LabelableObject, setCombination SetCombination, ...) (string, []interface{}, error)
- func FilterSubquery(queryFor model.LabelableObject, setCombination SetCombination, ...) (string, []interface{}, error)
- func NewConverter() *converter
- func NewLabelService(labelRepo LabelRepository, labelDefinitionRepo LabelDefinitionRepository, ...) *labelService
- func NewRepository(conv Converter) *repository
- func ValueToStringsSlice(value interface{}) ([]string, error)
- type Collection
- type Converter
- type Entity
- type LabelDefinitionRepository
- type LabelRepository
- type ParentAccessVerifier
- type SetCombination
- type UIDService
Constants ¶
This section is empty.
Variables ¶
var GlobalSystemRoleLabelKey string
GlobalSystemRoleLabelKey is a global variable containing the name of the system role label
Functions ¶
func ExtractValueFromJSONPath ¶
ExtractValueFromJSONPath returns the value that is placed in the SQL/JSON path query
For a given JSON path $[*] ? (@ == "dd") it extracts the actual value - dd For a given JSON path $[*] ? (@ == "dd" || @ == "ww") it extracts the actual values - dd and ww
func FilterQuery ¶
func FilterQuery(queryFor model.LabelableObject, setCombination SetCombination, tenant uuid.UUID, filter []*labelfilter.LabelFilter) (string, []interface{}, error)
FilterQuery builds select query for given filters
It supports querying defined by `queryFor` parameter. All queries are created in the context of given tenant
func FilterQueryGlobal ¶
func FilterQueryGlobal(queryFor model.LabelableObject, setCombination SetCombination, filters []*labelfilter.LabelFilter) (string, []interface{}, error)
FilterQueryGlobal builds select query for given filters
It supports querying defined by `queryFor` parameter. All queries are created in the global context
func FilterSubquery ¶
func FilterSubquery(queryFor model.LabelableObject, setCombination SetCombination, tenant uuid.UUID, filter []*labelfilter.LabelFilter) (string, []interface{}, error)
FilterSubquery builds select sub query for given filters that can be appended to other query
It supports querying defined by `queryFor` parameter. All queries are created in the context of given tenant
func NewLabelService ¶
func NewLabelService(labelRepo LabelRepository, labelDefinitionRepo LabelDefinitionRepository, uidService UIDService) *labelService
NewLabelService missing godoc
func ValueToStringsSlice ¶
ValueToStringsSlice missing godoc
Types ¶
type Collection ¶
type Collection []Entity
Collection is a collection of label entities.
func (Collection) Len ¶
func (c Collection) Len() int
Len returns the number of entities in the collection.
type Converter ¶
type Converter interface { ToEntity(in *model.Label) (*Entity, error) FromEntity(in *Entity) (*model.Label, error) }
Converter missing godoc
type Entity ¶
type Entity struct { ID string `db:"id"` TenantID sql.NullString `db:"tenant_id"` Key string `db:"key"` AppID sql.NullString `db:"app_id"` RuntimeID sql.NullString `db:"runtime_id"` RuntimeContextID sql.NullString `db:"runtime_context_id"` AppTemplateID sql.NullString `db:"app_template_id"` WebhookID sql.NullString `db:"webhook_id"` FormationTemplateID sql.NullString `db:"formation_template_id"` Value string `db:"value"` Version int `db:"version"` }
Entity is a label entity.
func (*Entity) DecorateWithTenantID ¶
DecorateWithTenantID decorates the entity with the given tenant ID.
type LabelDefinitionRepository ¶
type LabelDefinitionRepository interface { Create(ctx context.Context, def model.LabelDefinition) error Exists(ctx context.Context, tenant string, key string) (bool, error) GetByKey(ctx context.Context, tenant string, key string) (*model.LabelDefinition, error) }
LabelDefinitionRepository missing godoc
type LabelRepository ¶
type LabelRepository interface { Create(ctx context.Context, tenant string, label *model.Label) error Upsert(ctx context.Context, tenant string, label *model.Label) error UpsertGlobal(ctx context.Context, label *model.Label) error UpdateWithVersion(ctx context.Context, tenant string, label *model.Label) error GetByKey(ctx context.Context, tenant string, objectType model.LabelableObject, objectID, key string) (*model.Label, error) GetByKeyGlobal(ctx context.Context, objectType model.LabelableObject, objectID, key string) (*model.Label, error) Delete(ctx context.Context, tenantID string, objectType model.LabelableObject, objectID string, key string) error ListForObject(ctx context.Context, tenantID string, objectType model.LabelableObject, objectID string) (map[string]*model.Label, error) }
LabelRepository missing godoc
type ParentAccessVerifier ¶
type ParentAccessVerifier struct {
// contains filtered or unexported fields
}
ParentAccessVerifier defines parent access verifier
func NewDefaultParentAccessVerifier ¶
func NewDefaultParentAccessVerifier() *ParentAccessVerifier
NewDefaultParentAccessVerifier creates new ParentAccessVerifier with default converter and label repository
func NewParentAccessVerifier ¶
func NewParentAccessVerifier(labelRepo LabelRepository) *ParentAccessVerifier
NewParentAccessVerifier creates new ParentAccessVerifier
type SetCombination ¶
type SetCombination string
SetCombination type defines possible result set combination for querying
const ( // IntersectSet missing godoc IntersectSet SetCombination = "INTERSECT" // ExceptSet missing godoc ExceptSet SetCombination = "EXCEPT" // UnionSet missing godoc UnionSet SetCombination = "UNION" )