Documentation
¶
Index ¶
- type ApiKeyRepository
- type DatabaseStorage
- type FeeRepository
- type PluginPolicySyncRepository
- type PluginRepository
- type PolicyRepository
- type PoolProvider
- type PricingRepository
- type RatingRepository
- type RedisStorage
- func (r *RedisStorage) CheckNonceExists(ctx context.Context, nonce string, publicKey string) (bool, error)
- func (r *RedisStorage) Close() error
- func (r *RedisStorage) Delete(ctx context.Context, key string) error
- func (r *RedisStorage) Exists(ctx context.Context, key string) (bool, error)
- func (r *RedisStorage) Expire(ctx context.Context, key string, expiry time.Duration) error
- func (r *RedisStorage) Get(ctx context.Context, key string) (string, error)
- func (r *RedisStorage) Set(ctx context.Context, key string, value string, expiry time.Duration) error
- func (r *RedisStorage) StoreNonce(ctx context.Context, nonce string, publicKey string, expiryTime time.Time) error
- type ReviewRepository
- type TagRepository
- type Transactor
- type VaultTokenRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiKeyRepository ¶
type DatabaseStorage ¶
type DatabaseStorage interface {
Transactor
PolicyRepository
PluginPolicySyncRepository
VaultTokenRepository
PricingRepository
PluginRepository
FeeRepository
TagRepository
ReviewRepository
RatingRepository
ApiKeyRepository
Close() error
}
type FeeRepository ¶
type FeeRepository interface {
GetFeeById(ctx context.Context, id uint64) (*types.Fee, error)
GetFeesByPublicKey(ctx context.Context, publicKey string) ([]*types.Fee, error)
InsertFee(ctx context.Context, dbTx pgx.Tx, fee *types.Fee) (uint64, error)
InsertPluginInstallation(ctx context.Context, dbTx pgx.Tx, pluginID types.PluginID, publicKey string) error
MarkFeesCollected(ctx context.Context, dbTx pgx.Tx, feeIDs []uint64, txHash string, totalAmount uint64) error
GetUserFees(ctx context.Context, publicKey string) (*types.UserFeeStatus, error)
UpdateBatchStatus(ctx context.Context, dbTx pgx.Tx, txHash string, status *rpc.TxOnChainStatus) error
}
type PluginPolicySyncRepository ¶
type PluginPolicySyncRepository interface {
AddPluginPolicySync(ctx context.Context, dbTx pgx.Tx, policy itypes.PluginPolicySync) error
GetPluginPolicySync(ctx context.Context, id uuid.UUID) (*itypes.PluginPolicySync, error)
DeletePluginPolicySync(ctx context.Context, id uuid.UUID) error
GetUnFinishedPluginPolicySyncs(ctx context.Context) ([]itypes.PluginPolicySync, error)
UpdatePluginPolicySync(ctx context.Context, dbTx pgx.Tx, policy itypes.PluginPolicySync) error
}
type PluginRepository ¶
type PolicyRepository ¶
type PolicyRepository interface {
GetPluginPolicy(ctx context.Context, id uuid.UUID) (*types.PluginPolicy, error)
GetPluginPolicies(ctx context.Context, publicKey string, pluginIds []types.PluginID, includeInactive bool) ([]types.PluginPolicy, error)
GetPluginInstallationsCount(ctx context.Context, pluginID types.PluginID) (itypes.PluginTotalCount, error)
GetAllPluginPolicies(ctx context.Context, publicKey string, pluginID types.PluginID, take int, skip int, includeInactive bool) (*itypes.PluginPolicyPaginatedList, error)
DeletePluginPolicyTx(ctx context.Context, dbTx pgx.Tx, id uuid.UUID) error
InsertPluginPolicyTx(ctx context.Context, dbTx pgx.Tx, policy types.PluginPolicy) (*types.PluginPolicy, error)
UpdatePluginPolicyTx(ctx context.Context, dbTx pgx.Tx, policy types.PluginPolicy) (*types.PluginPolicy, error)
DeleteAllPolicies(ctx context.Context, dbTx pgx.Tx, pluginID types.PluginID, publicKey string) error
}
type PoolProvider ¶
type PricingRepository ¶
type PricingRepository interface {
GetPricingByPluginId(ctx context.Context, pluginId types.PluginID) ([]types.Pricing, error)
FindPricingById(ctx context.Context, id uuid.UUID) (*types.Pricing, error)
CreatePricing(ctx context.Context, pricingDto types.PricingCreateDto) (*types.Pricing, error)
DeletePricingById(ctx context.Context, id uuid.UUID) error
}
type RatingRepository ¶
type RatingRepository interface {
FindRatingByPluginId(ctx context.Context, dbTx pgx.Tx, pluginId string) ([]itypes.PluginRatingDto, error)
FindAvgRatingByPluginID(ctx context.Context, pluginID string) (itypes.PluginAvgRatingDto, error)
CreateRatingForPlugin(ctx context.Context, dbTx pgx.Tx, pluginId string) error
UpdateRatingForPlugin(ctx context.Context, dbTx pgx.Tx, pluginId string, reviewRating int) error
}
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func NewRedisStorage ¶
func NewRedisStorage(cfg config.Redis) (*RedisStorage, error)
func (*RedisStorage) CheckNonceExists ¶
func (r *RedisStorage) CheckNonceExists(ctx context.Context, nonce string, publicKey string) (bool, error)
CheckNonceExists checks if a nonce has been used by the same public key
func (*RedisStorage) Close ¶
func (r *RedisStorage) Close() error
func (*RedisStorage) StoreNonce ¶
func (r *RedisStorage) StoreNonce(ctx context.Context, nonce string, publicKey string, expiryTime time.Time) error
StoreNonce stores a nonce in Redis with automatic expiration
type ReviewRepository ¶
type ReviewRepository interface {
CreateReview(ctx context.Context, dbTx pgx.Tx, reviewDto itypes.ReviewCreateDto, pluginId string) (string, error)
FindReviews(ctx context.Context, pluginId string, take int, skip int, sort string) (itypes.ReviewsDto, error)
FindReviewById(ctx context.Context, db pgx.Tx, id string) (*itypes.ReviewDto, error)
}
type TagRepository ¶
type Transactor ¶
type VaultTokenRepository ¶
type VaultTokenRepository interface {
CreateVaultToken(ctx context.Context, token itypes.VaultTokenCreate) (*itypes.VaultToken, error)
GetVaultToken(ctx context.Context, tokenID string) (*itypes.VaultToken, error)
RevokeVaultToken(ctx context.Context, tokenID string) error
RevokeAllVaultTokens(ctx context.Context, publicKey string) error
UpdateVaultTokenLastUsed(ctx context.Context, tokenID string) error
GetActiveVaultTokens(ctx context.Context, publicKey string) ([]itypes.VaultToken, error)
}
Click to show internal directories.
Click to hide internal directories.