Documentation ¶
Index ¶
- Constants
- func ConcatWithSepFunc(dialect string) func(string, ...any) exp.Expression
- func ConnectWithRetries(driverName, connStr string, retries uint64) (*sqlx.DB, error)
- type ConnPoolConf
- type DBOpt
- type DBStorage
- type Policy
- type PolicyAncestor
- type PolicyCount
- type PolicyDefWrapper
- type PolicyDependency
- type PolicyRevision
- type Schema
Constants ¶
View Source
const ( PolicyTbl = "policy" PolicyTblIDCol = "id" PolicyTblKindCol = "kind" PolicyTblNameCol = "name" PolicyTblVerCol = "version" PolicyTblScopeCol = "scope" PolicyTblDefinitionCol = "definition" PolicyTblDisabledCol = "disabled" PolicyDepTbl = "policy_dependency" PolicyDepTblPolicyIDCol = "policy_id" PolicyDepTblDepIDCol = "dependency_id" PolicyAncestorTbl = "policy_ancestor" PolicyAncestorTblPolicyIDCol = "policy_id" PolicyAncestorTblAncestorIDCol = "ancestor_id" SchemaTbl = "attr_schema_defs" SchemaTblIDCol = "id" SchemaTblDefinitionCol = "definition" )
View Source
const DBConnectionRetries = 3
Variables ¶
This section is empty.
Functions ¶
func ConcatWithSepFunc ¶ added in v0.12.0
func ConcatWithSepFunc(dialect string) func(string, ...any) exp.Expression
Types ¶
type ConnPoolConf ¶
type ConnPoolConf struct { MaxLifetime time.Duration `yaml:"maxLifeTime"` MaxIdleTime time.Duration `yaml:"maxIdleTime"` MaxOpen uint `yaml:"maxOpen"` MaxIdle uint `yaml:"maxIdle"` }
ConnPoolConf holds common SQL connection pool settings.
func (*ConnPoolConf) Configure ¶
func (cc *ConnPoolConf) Configure(db *sqlx.DB)
type DBOpt ¶ added in v0.13.0
type DBOpt func(*dbOpt)
DBOpt defines database driver options.
func WithUpsertPolicy ¶ added in v0.13.0
func WithUpsertPolicy(f upsertPolicyFunc) DBOpt
WithUpsertPolicy sets custom upsert policy function.
func WithUpsertSchema ¶ added in v0.13.0
func WithUpsertSchema(f upsertSchemaFunc) DBOpt
WithUpsertSchema sets custom upsert schema function.
type DBStorage ¶
type DBStorage interface { storage.Subscribable storage.Instrumented storage.Reloadable AddOrUpdate(ctx context.Context, policies ...policy.Wrapper) error GetCompilationUnits(ctx context.Context, ids ...namer.ModuleID) (map[namer.ModuleID]*policy.CompilationUnit, error) GetDependents(ctx context.Context, ids ...namer.ModuleID) (map[namer.ModuleID][]namer.ModuleID, error) Delete(ctx context.Context, ids ...namer.ModuleID) error ListPolicyIDs(ctx context.Context) ([]string, error) ListSchemaIDs(ctx context.Context) ([]string, error) AddOrUpdateSchema(ctx context.Context, schemas ...*schemav1.Schema) error DeleteSchema(ctx context.Context, ids ...string) error LoadSchema(ctx context.Context, url string) (io.ReadCloser, error) LoadPolicy(ctx context.Context, policyKey ...string) ([]*policy.Wrapper, error) }
type PolicyAncestor ¶ added in v0.13.0
type PolicyCount ¶ added in v0.15.0
type PolicyDefWrapper ¶
func (*PolicyDefWrapper) Scan ¶
func (pdw *PolicyDefWrapper) Scan(src any) error
type PolicyDependency ¶
type PolicyRevision ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.