Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteEntity(ctx context.Context, id string) error
- func DeleteFacet(ctx context.Context, logger util.Logger, id string) error
- func Healthcheck(ctx context.Context) error
- func IndexFromBson(input bson.D)
- func NewConnection(ctx context.Context, logger util.Logger) (*mongo.Client, error)
- type Entity
- func CreateEntity(ctx context.Context, path string, attributes map[string]interface{}) (*Entity, error)
- func GetEntity(ctx context.Context, id string) (*Entity, error)
- func ListEntities(ctx context.Context, filter interface{}) ([]*Entity, error)
- func NewEntity(path string, attributes map[string]interface{}) *Entity
- func UpdateEntity(ctx context.Context, id string, attributes map[string]interface{}) (*Entity, error)
- type EntityAttributes
- type EntityMeta
- type Facet
- func AssertFacet(ctx context.Context, key string, sort SortType) (*Facet, error)
- func CreateFacet(ctx context.Context, logger util.Logger, key string, sort SortType) (*Facet, error)
- func FacetFromBson(raw interface{}) (*Facet, error)
- func FacetFromBytes(raw []byte) (*Facet, error)
- func ListFacets(ctx context.Context, logger util.Logger) ([]*Facet, error)
- type Index
- type SortType
Constants ¶
View Source
const (
EntityCollectionName = "entities"
)
Variables ¶
Functions ¶
func Healthcheck ¶
func IndexFromBson ¶
Types ¶
type Entity ¶
type Entity struct { ID string `bson:"_id" json:"_id,omitempty"` Dir string `bson:"dir" json:"dir"` Base string `bson:"base" json:"base"` Attributes map[string]interface{} `bson:"attributes" json:"attributes"` CreatedAt time.Time `bson:"created_at" json:"created_at"` UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` }
func CreateEntity ¶
type EntityAttributes ¶
type EntityAttributes struct { Path string `bson:"path" json:"path"` Attributes map[string]interface{} `bson:"attributes" json:"attributes"` }
func EntityAttributesFromBytes ¶
func EntityAttributesFromBytes(input []byte) (*EntityAttributes, error)
type EntityMeta ¶
type EntityMeta struct {
Indicies []string
}
Click to show internal directories.
Click to hide internal directories.