Documentation
¶
Index ¶
- Constants
- Variables
- func LastIdSpecToString(lastIdSpec LastIdSpec) (string, error)
- func QueryHandler(svc QueryService, w http.ResponseWriter, r *http.Request) error
- type ByObjectIdAsc
- type ByObjectIdDesc
- type ByObjectTypeAsc
- type ByObjectTypeDesc
- type LastIdSpec
- type Query
- type QueryHaving
- type QueryListParamParser
- type QueryResult
- type QueryService
- type Resource
- type Result
- type ResultSet
- func (rs *ResultSet) Add(objectType string, objectId string, warrant warrant.WarrantSpec)
- func (rs ResultSet) Get(objectType string, objectId string) *ResultSetNode
- func (rs ResultSet) Has(objectType string, objectId string) bool
- func (rs ResultSet) Intersect(other *ResultSet) *ResultSet
- func (rs ResultSet) Len() int
- func (rs ResultSet) List() *ResultSetNode
- func (rs ResultSet) String() string
- func (rs ResultSet) Union(other *ResultSet) *ResultSet
- type ResultSetNode
- type SelectObjects
- type SelectSubjects
Constants ¶
View Source
const ( MaxObjectTypes = 1000 MaxEdges = 5000 )
Variables ¶
View Source
var ErrInvalidQuery = errors.New("invalid query")
Functions ¶
func LastIdSpecToString ¶
func LastIdSpecToString(lastIdSpec LastIdSpec) (string, error)
func QueryHandler ¶
func QueryHandler(svc QueryService, w http.ResponseWriter, r *http.Request) error
Types ¶
type ByObjectIdAsc ¶
type ByObjectIdAsc []QueryResult
func (ByObjectIdAsc) Len ¶
func (res ByObjectIdAsc) Len() int
func (ByObjectIdAsc) Less ¶
func (res ByObjectIdAsc) Less(i, j int) bool
func (ByObjectIdAsc) Swap ¶
func (res ByObjectIdAsc) Swap(i, j int)
type ByObjectIdDesc ¶
type ByObjectIdDesc []QueryResult
func (ByObjectIdDesc) Len ¶
func (res ByObjectIdDesc) Len() int
func (ByObjectIdDesc) Less ¶
func (res ByObjectIdDesc) Less(i, j int) bool
func (ByObjectIdDesc) Swap ¶
func (res ByObjectIdDesc) Swap(i, j int)
type ByObjectTypeAsc ¶
type ByObjectTypeAsc []QueryResult
func (ByObjectTypeAsc) Len ¶
func (res ByObjectTypeAsc) Len() int
func (ByObjectTypeAsc) Less ¶
func (res ByObjectTypeAsc) Less(i, j int) bool
func (ByObjectTypeAsc) Swap ¶
func (res ByObjectTypeAsc) Swap(i, j int)
type ByObjectTypeDesc ¶
type ByObjectTypeDesc []QueryResult
func (ByObjectTypeDesc) Len ¶
func (res ByObjectTypeDesc) Len() int
func (ByObjectTypeDesc) Less ¶
func (res ByObjectTypeDesc) Less(i, j int) bool
func (ByObjectTypeDesc) Swap ¶
func (res ByObjectTypeDesc) Swap(i, j int)
type LastIdSpec ¶
func StringToLastIdSpec ¶
func StringToLastIdSpec(base64Str string) (*LastIdSpec, error)
type Query ¶
type Query struct {
Expand bool
SelectSubjects *SelectSubjects
SelectObjects *SelectObjects
Context *baseWarrant.PolicyContext
}
func NewQueryFromString ¶
type QueryHaving ¶
type QueryListParamParser ¶
type QueryListParamParser struct{}
func (QueryListParamParser) GetDefaultSortBy ¶
func (parser QueryListParamParser) GetDefaultSortBy() string
func (QueryListParamParser) GetSupportedSortBys ¶
func (parser QueryListParamParser) GetSupportedSortBys() []string
func (QueryListParamParser) ParseValue ¶
func (parser QueryListParamParser) ParseValue(val string, sortBy string) (interface{}, error)
type QueryResult ¶
type QueryResult struct {
ObjectType string `json:"objectType"`
ObjectId string `json:"objectId"`
Warrant baseWarrant.WarrantSpec `json:"warrant"`
IsImplicit bool `json:"isImplicit"`
Meta map[string]interface{} `json:"meta,omitempty"`
}
type QueryService ¶
type QueryService struct {
service.BaseService
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env service.Env, objectTypeSvc objecttype.Service, warrantSvc warrant.Service, objectSvc object.Service) QueryService
func (QueryService) Query ¶
func (svc QueryService) Query(ctx context.Context, query *Query, listParams service.ListParams) (*Result, error)
type Result ¶
type Result struct {
Results []QueryResult `json:"results"`
LastId string `json:"lastId,omitempty"`
}
type ResultSet ¶
type ResultSet struct {
// contains filtered or unexported fields
}
func NewResultSet ¶
func NewResultSet() *ResultSet
func (*ResultSet) Add ¶
func (rs *ResultSet) Add(objectType string, objectId string, warrant warrant.WarrantSpec)
func (ResultSet) List ¶
func (rs ResultSet) List() *ResultSetNode
type ResultSetNode ¶
type ResultSetNode struct {
ObjectType string
ObjectId string
Warrant warrant.WarrantSpec
// contains filtered or unexported fields
}
func (ResultSetNode) Next ¶
func (node ResultSetNode) Next() *ResultSetNode
type SelectObjects ¶
type SelectSubjects ¶
Click to show internal directories.
Click to hide internal directories.