Documentation ¶
Overview ¶
Package sql implements server model interfaces. Supports at least SQLite and PostgreSQL.
Index ¶
- Constants
- Variables
- type Config
- type Endpoint
- func (x *Endpoint) CheckNonce(ctx Context, scope []byte, nonce string, expire time.Time) error
- func (x *Endpoint) Close() error
- func (x *Endpoint) GetInstance(ctx Context, pri principal.ID, instance string, buf proto.Message) (bool, error)
- func (x *Endpoint) GetModule(ctx Context, pri principal.ID, module string, buf proto.Message) (bool, error)
- func (x *Endpoint) GetSourceSHA256(ctx Context, source string) (string, error)
- func (x *Endpoint) InitInventory(ctx Context) error
- func (x *Endpoint) InitNonceChecker(ctx Context) error
- func (x *Endpoint) InitSourceCache(ctx Context) error
- func (x *Endpoint) PutInstance(ctx Context, pri principal.ID, instance string, buf proto.Message) error
- func (x *Endpoint) PutModule(ctx Context, pri principal.ID, module string, buf proto.Message) error
- func (x *Endpoint) PutSourceSHA256(ctx Context, source, module string) error
- func (x *Endpoint) RemoveInstance(ctx Context, pri principal.ID, instance string) error
- func (x *Endpoint) RemoveModule(ctx Context, pri principal.ID, module string) error
- func (x *Endpoint) UpdateInstance(ctx Context, pri principal.ID, instance string, buf proto.Message) error
- func (x *Endpoint) UpdateModule(ctx Context, pri principal.ID, module string, buf proto.Message) error
Constants ¶
View Source
const InventorySchema = `` /* 336-byte string literal not displayed */
View Source
const NonceSchema = `` /* 219-byte string literal not displayed */
View Source
const SourceSchema = `` /* 138-byte string literal not displayed */
Variables ¶
View Source
var Adapter = database.Register(&database.Adapter{ Name: "sql", NewConfig: func() database.Config { return &adaptedConfig{ Config: DefaultConfig.Clone(), } }, Open: func(config database.Config) (database.Endpoint, error) { x, err := Open(config.(*adaptedConfig).Config) if err != nil { return nil, err } return x, err }, InitInventory: func(ctx Context, endpoint database.Endpoint) (model.Inventory, error) { x := endpoint.(*Endpoint) if err := x.InitInventory(ctx); err != nil { return nil, err } return x, nil }, InitSourceCache: func(ctx Context, endpoint database.Endpoint) (model.SourceCache, error) { x := endpoint.(*Endpoint) if err := x.InitSourceCache(ctx); err != nil { return nil, err } return x, nil }, InitNonceChecker: func(ctx Context, endpoint database.Endpoint) (model.NonceChecker, error) { x := endpoint.(*Endpoint) if err := x.InitNonceChecker(ctx); err != nil { return nil, err } return x, nil }, })
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func (*Endpoint) CheckNonce ¶
func (*Endpoint) GetInstance ¶
func (*Endpoint) GetSourceSHA256 ¶
func (*Endpoint) InitInventory ¶
func (*Endpoint) InitNonceChecker ¶
func (*Endpoint) InitSourceCache ¶
func (*Endpoint) PutInstance ¶
func (*Endpoint) PutSourceSHA256 ¶
func (*Endpoint) RemoveInstance ¶
func (*Endpoint) RemoveModule ¶
func (*Endpoint) UpdateInstance ¶
Click to show internal directories.
Click to hide internal directories.