service

package
v0.1.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEntityNotFound      = errors.New("entity not found")
	ErrPolicyNotFound      = errors.New("policy not found")
	ErrPolicyAlreadyExists = errors.New("policy already exists")
)
View Source
var (
	ErrEntityAlreadyExists = errors.New("entity already exists")
)

Functions

func New

func New() *service

Types

type Base

type Base struct {
	CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"`
	UpdatedAt time.Time `bun:"updated_at,nullzero,notnull,default:current_timestamp"`
}

type Entity

type Entity struct {
	bun.BaseModel `bun:"table:entities,alias:e"`
	ID            string       `bun:",pk"`
	Type          string       `bun:"type,pk"`
	Parents       []UID        `bun:"parents,type:json"`
	Attributes    cedar.Record `bun:"attributes,type:json"`
	Tags          cedar.Record `bun:"tags,type:json"`
	Base
}

type Policy

type Policy struct {
	bun.BaseModel `bun:"table:policies,alias:p"`
	ID            string `bun:"id,pk"`
	Content       string `bun:"content"`
	Base
}

type UID

type UID struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL