Documentation
¶
Overview ¶
Package store encapsulates all database interaction.
Index ¶
- type AgoricSubscription
- type BSNIritaSubscription
- type BinanceSmartChainSubscription
- type CfxSubscription
- type Client
- func (client Client) Close() error
- func (client Client) DeleteAllEndpointsExcept(names []string) error
- func (client Client) DeleteEndpoint(name string) error
- func (client Client) DeleteSubscription(sub *Subscription) error
- func (client Client) LoadEndpoint(name string) (Endpoint, error)
- func (client Client) LoadSubscription(jobid string) (*Subscription, error)
- func (client Client) LoadSubscriptions() ([]Subscription, error)
- func (client Client) RestoreEndpoint(name string) error
- func (client Client) SaveEndpoint(endpoint *Endpoint) error
- func (client Client) SaveSubscription(sub *Subscription) error
- type Endpoint
- type EthSubscription
- type KeeperSubscription
- type NEARSubscription
- type OntSubscription
- type RuntimeConfig
- type SQLBytes
- type SQLStringArray
- type Subscription
- type SubstrateSubscription
- type TezosSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgoricSubscription ¶
type BSNIritaSubscription ¶
type BSNIritaSubscription struct {
gorm.Model
SubscriptionId uint
Addresses SQLStringArray
ServiceName string
}
type BinanceSmartChainSubscription ¶
type BinanceSmartChainSubscription struct {
gorm.Model
SubscriptionId uint
Addresses SQLStringArray
}
type CfxSubscription ¶
type CfxSubscription struct {
gorm.Model
SubscriptionId uint
Addresses SQLStringArray
Topics SQLStringArray
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds a connection to the database.
func ConnectToDb ¶
ConnectToDB attempts to connect to the database URI provided, and returns a new Client instance if successful.
func (Client) DeleteAllEndpointsExcept ¶
DeleteAllEndpointsExcept will call DeleteEndpoint on all endpoints not provided.
func (Client) DeleteEndpoint ¶
DeleteEndpoint will soft-delete any endpoint record with the name provided, as well as any Subscriptions using this endpoint.
func (Client) DeleteSubscription ¶
func (client Client) DeleteSubscription(sub *Subscription) error
DeleteSubscription will soft-delete the subscription provided.
func (Client) LoadEndpoint ¶
LoadEndpoint will return the endpoint in the database with the name provided.
func (Client) LoadSubscription ¶
func (client Client) LoadSubscription(jobid string) (*Subscription, error)
func (Client) LoadSubscriptions ¶
func (client Client) LoadSubscriptions() ([]Subscription, error)
LoadSubscriptions will find all subscriptions in the database, along with their associated endpoint and blockchain configuration, and return them in a slice.
func (Client) RestoreEndpoint ¶
RestoreEndpoint will restore any soft-deleted endpoint with the name provided.
func (Client) SaveEndpoint ¶
SaveEndpoint will store the endpoint in the database and overwrite any previous record with the same name.
func (Client) SaveSubscription ¶
func (client Client) SaveSubscription(sub *Subscription) error
SaveSubscription will validate that the Endpoint exists, then store the Subscription in the database.
type EthSubscription ¶
type EthSubscription struct {
gorm.Model
SubscriptionId uint
Addresses SQLStringArray
Topics SQLStringArray
}
type KeeperSubscription ¶
type NEARSubscription ¶
type NEARSubscription struct {
gorm.Model
SubscriptionId uint
AccountIds SQLStringArray
}
type OntSubscription ¶
type OntSubscription struct {
gorm.Model
SubscriptionId uint
Addresses SQLStringArray
}
type RuntimeConfig ¶
type RuntimeConfig struct {
KeeperBlockCooldown int64
}
type SQLBytes ¶
type SQLBytes []byte
SQLBytes is a byte slice stored in the database as a string.
type SQLStringArray ¶
type SQLStringArray []string
SQLStringArray is a string array stored in the database as comma separated values.
func (*SQLStringArray) Scan ¶
func (arr *SQLStringArray) Scan(src interface{}) error
Scan implements the sql Scanner interface.
type Subscription ¶
type Subscription struct {
gorm.Model
ReferenceId string
Job string
EndpointName string
Endpoint Endpoint `gorm:"-"`
Ethereum EthSubscription
Tezos TezosSubscription
Substrate SubstrateSubscription
Ontology OntSubscription
BinanceSmartChain BinanceSmartChainSubscription
NEAR NEARSubscription
Conflux CfxSubscription
Keeper KeeperSubscription
BSNIrita BSNIritaSubscription
Agoric AgoricSubscription
}
type SubstrateSubscription ¶
type SubstrateSubscription struct {
gorm.Model
SubscriptionId uint
AccountIds SQLStringArray
}
type TezosSubscription ¶
type TezosSubscription struct {
gorm.Model
SubscriptionId uint
Addresses SQLStringArray
}