Documentation ¶
Index ¶
- Constants
- Variables
- type Audit
- type AuditRepository
- type BehaviorConfig
- type BillingCheckoutRepository
- func (r BillingCheckoutRepository) Create(ctx context.Context, toCreate checkout.Checkout) (checkout.Checkout, error)
- func (r BillingCheckoutRepository) GetByID(ctx context.Context, id string) (checkout.Checkout, error)
- func (r BillingCheckoutRepository) GetByName(ctx context.Context, name string) (checkout.Checkout, error)
- func (r BillingCheckoutRepository) List(ctx context.Context, flt checkout.Filter) ([]checkout.Checkout, error)
- func (r BillingCheckoutRepository) UpdateByID(ctx context.Context, toUpdate checkout.Checkout) (checkout.Checkout, error)
- type BillingCustomerRepository
- func (r BillingCustomerRepository) Create(ctx context.Context, toCreate customer.Customer) (customer.Customer, error)
- func (r BillingCustomerRepository) Delete(ctx context.Context, id string) error
- func (r BillingCustomerRepository) GetByID(ctx context.Context, id string) (customer.Customer, error)
- func (r BillingCustomerRepository) List(ctx context.Context, flt customer.Filter) ([]customer.Customer, error)
- func (r BillingCustomerRepository) UpdateByID(ctx context.Context, toUpdate customer.Customer) (customer.Customer, error)
- type BillingFeatureRepository
- func (r BillingFeatureRepository) Create(ctx context.Context, toCreate product.Feature) (product.Feature, error)
- func (r BillingFeatureRepository) GetByID(ctx context.Context, id string) (product.Feature, error)
- func (r BillingFeatureRepository) GetByName(ctx context.Context, name string) (product.Feature, error)
- func (r BillingFeatureRepository) List(ctx context.Context, flt product.Filter) ([]product.Feature, error)
- func (r BillingFeatureRepository) UpdateByName(ctx context.Context, toUpdate product.Feature) (product.Feature, error)
- type BillingInvoiceRepository
- func (r BillingInvoiceRepository) Create(ctx context.Context, toCreate invoice.Invoice) (invoice.Invoice, error)
- func (r BillingInvoiceRepository) Delete(ctx context.Context, id string) error
- func (r BillingInvoiceRepository) GetByID(ctx context.Context, id string) (invoice.Invoice, error)
- func (r BillingInvoiceRepository) List(ctx context.Context, flt invoice.Filter) ([]invoice.Invoice, error)
- func (r BillingInvoiceRepository) UpdateByID(ctx context.Context, toUpdate invoice.Invoice) (invoice.Invoice, error)
- type BillingPlanRepository
- func (r BillingPlanRepository) Create(ctx context.Context, toCreate plan.Plan) (plan.Plan, error)
- func (r BillingPlanRepository) GetByID(ctx context.Context, id string) (plan.Plan, error)
- func (r BillingPlanRepository) GetByName(ctx context.Context, name string) (plan.Plan, error)
- func (r BillingPlanRepository) List(ctx context.Context, filter plan.Filter) ([]plan.Plan, error)
- func (r BillingPlanRepository) UpdateByName(ctx context.Context, toUpdate plan.Plan) (plan.Plan, error)
- type BillingPriceRepository
- func (r BillingPriceRepository) Create(ctx context.Context, toCreate product.Price) (product.Price, error)
- func (r BillingPriceRepository) GetByID(ctx context.Context, id string) (product.Price, error)
- func (r BillingPriceRepository) GetByName(ctx context.Context, name string) (product.Price, error)
- func (r BillingPriceRepository) List(ctx context.Context, filter product.Filter) ([]product.Price, error)
- func (r BillingPriceRepository) UpdateByID(ctx context.Context, toUpdate product.Price) (product.Price, error)
- type BillingProductRepository
- func (r BillingProductRepository) Create(ctx context.Context, toCreate product.Product) (product.Product, error)
- func (r BillingProductRepository) GetByID(ctx context.Context, id string) (product.Product, error)
- func (r BillingProductRepository) GetByName(ctx context.Context, name string) (product.Product, error)
- func (r BillingProductRepository) List(ctx context.Context, flt product.Filter) ([]product.Product, error)
- func (r BillingProductRepository) UpdateByName(ctx context.Context, toUpdate product.Product) (product.Product, error)
- type BillingSubscriptionRepository
- func (r BillingSubscriptionRepository) Create(ctx context.Context, toCreate subscription.Subscription) (subscription.Subscription, error)
- func (r BillingSubscriptionRepository) Delete(ctx context.Context, id string) error
- func (r BillingSubscriptionRepository) GetByID(ctx context.Context, id string) (subscription.Subscription, error)
- func (r BillingSubscriptionRepository) GetByName(ctx context.Context, name string) (subscription.Subscription, error)
- func (r BillingSubscriptionRepository) GetByProviderID(ctx context.Context, id string) (subscription.Subscription, error)
- func (r BillingSubscriptionRepository) List(ctx context.Context, filter subscription.Filter) ([]subscription.Subscription, error)
- func (r BillingSubscriptionRepository) UpdateByID(ctx context.Context, toUpdate subscription.Subscription) (subscription.Subscription, error)
- type BillingTransactionRepository
- func (r BillingTransactionRepository) CreateEntry(ctx context.Context, debitEntry credit.Transaction, ...) ([]credit.Transaction, error)
- func (r BillingTransactionRepository) GetBalance(ctx context.Context, accountID string) (int64, error)
- func (r BillingTransactionRepository) GetByID(ctx context.Context, id string) (credit.Transaction, error)
- func (r BillingTransactionRepository) List(ctx context.Context, filter credit.Filter) ([]credit.Transaction, error)
- func (r BillingTransactionRepository) UpdateByID(ctx context.Context, toUpdate credit.Transaction) (credit.Transaction, error)
- type Checkout
- type Customer
- type Domain
- type DomainRepository
- func (s *DomainRepository) Create(ctx context.Context, toCreate domain.Domain) (domain.Domain, error)
- func (s *DomainRepository) Delete(ctx context.Context, id string) error
- func (s *DomainRepository) DeleteExpiredDomainRequests(ctx context.Context) error
- func (s *DomainRepository) Get(ctx context.Context, id string) (domain.Domain, error)
- func (s *DomainRepository) List(ctx context.Context, flt domain.Filter) ([]domain.Domain, error)
- func (s *DomainRepository) Update(ctx context.Context, toUpdate domain.Domain) (domain.Domain, error)
- type Feature
- type Flow
- type FlowRepository
- func (s *FlowRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (s *FlowRepository) DeleteExpiredFlows(ctx context.Context) error
- func (s *FlowRepository) Get(ctx context.Context, id uuid.UUID) (*authenticate.Flow, error)
- func (s *FlowRepository) Set(ctx context.Context, flow *authenticate.Flow) error
- type Group
- type GroupRepository
- func (r GroupRepository) Create(ctx context.Context, grp group.Group) (group.Group, error)
- func (r GroupRepository) Delete(ctx context.Context, id string) error
- func (r GroupRepository) GetByID(ctx context.Context, id string) (group.Group, error)
- func (r GroupRepository) GetByIDs(ctx context.Context, groupIDs []string, flt group.Filter) ([]group.Group, error)
- func (r GroupRepository) List(ctx context.Context, flt group.Filter) ([]group.Group, error)
- func (r GroupRepository) ListGroupRelations(ctx context.Context, objectId string, subject_type string, role string) ([]relation.Relation, error)
- func (r GroupRepository) SetState(ctx context.Context, id string, state group.State) error
- func (r GroupRepository) UpdateByID(ctx context.Context, grp group.Group) (group.Group, error)
- type Invitation
- type InvitationRepository
- func (s *InvitationRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (s *InvitationRepository) GarbageCollect(ctx context.Context) error
- func (s *InvitationRepository) Get(ctx context.Context, id uuid.UUID) (invitation.Invitation, error)
- func (s *InvitationRepository) List(ctx context.Context, flt invitation.Filter) ([]invitation.Invitation, error)
- func (s *InvitationRepository) ListByUser(ctx context.Context, id string) ([]invitation.Invitation, error)
- func (s *InvitationRepository) Set(ctx context.Context, invite invitation.Invitation) (invitation.Invitation, error)
- type Invoice
- type MetaSchema
- type MetaSchemaRepository
- func (m MetaSchemaRepository) Create(ctx context.Context, mschema metaschema.MetaSchema) (metaschema.MetaSchema, error)
- func (m MetaSchemaRepository) Delete(ctx context.Context, id string) (string, error)
- func (m MetaSchemaRepository) Get(ctx context.Context, id string) (metaschema.MetaSchema, error)
- func (m MetaSchemaRepository) List(ctx context.Context) ([]metaschema.MetaSchema, error)
- func (m MetaSchemaRepository) MigrateDefaults(ctx context.Context) error
- func (m MetaSchemaRepository) Update(ctx context.Context, id string, mschema metaschema.MetaSchema) (metaschema.MetaSchema, error)
- type Namespace
- type NamespaceRepository
- func (r NamespaceRepository) Get(ctx context.Context, id string) (namespace.Namespace, error)
- func (r NamespaceRepository) List(ctx context.Context) ([]namespace.Namespace, error)
- func (r NamespaceRepository) Update(ctx context.Context, ns namespace.Namespace) (namespace.Namespace, error)
- func (r NamespaceRepository) Upsert(ctx context.Context, ns namespace.Namespace) (namespace.Namespace, error)
- type Organization
- type OrganizationRepository
- func (r OrganizationRepository) Create(ctx context.Context, org organization.Organization) (organization.Organization, error)
- func (r OrganizationRepository) Delete(ctx context.Context, id string) error
- func (r OrganizationRepository) GetByID(ctx context.Context, id string) (organization.Organization, error)
- func (r OrganizationRepository) GetByIDs(ctx context.Context, ids []string) ([]organization.Organization, error)
- func (r OrganizationRepository) GetByName(ctx context.Context, name string) (organization.Organization, error)
- func (r OrganizationRepository) List(ctx context.Context, flt organization.Filter) ([]organization.Organization, error)
- func (r OrganizationRepository) SetState(ctx context.Context, id string, state organization.State) error
- func (r OrganizationRepository) UpdateByID(ctx context.Context, org organization.Organization) (organization.Organization, error)
- func (r OrganizationRepository) UpdateByName(ctx context.Context, org organization.Organization) (organization.Organization, error)
- type Permission
- type PermissionRepository
- func (r PermissionRepository) Delete(ctx context.Context, id string) error
- func (r PermissionRepository) Get(ctx context.Context, id string) (permission.Permission, error)
- func (r PermissionRepository) GetBySlug(ctx context.Context, slug string) (permission.Permission, error)
- func (r PermissionRepository) List(ctx context.Context, flt permission.Filter) ([]permission.Permission, error)
- func (r PermissionRepository) Update(ctx context.Context, act permission.Permission) (permission.Permission, error)
- func (r PermissionRepository) Upsert(ctx context.Context, perm permission.Permission) (permission.Permission, error)
- type Phase
- type Plan
- type Policy
- type PolicyCols
- type PolicyRepository
- func (r PolicyRepository) Count(ctx context.Context, flt policy.Filter) (int64, error)
- func (r PolicyRepository) Delete(ctx context.Context, id string) error
- func (r PolicyRepository) Get(ctx context.Context, id string) (policy.Policy, error)
- func (r PolicyRepository) GroupMemberCount(ctx context.Context, groupIDs []string) ([]policy.MemberCount, error)
- func (r PolicyRepository) List(ctx context.Context, flt policy.Filter) ([]policy.Policy, error)
- func (r PolicyRepository) OrgMemberCount(ctx context.Context, id string) (policy.MemberCount, error)
- func (r PolicyRepository) ProjectMemberCount(ctx context.Context, projectIDs []string) ([]policy.MemberCount, error)
- func (r PolicyRepository) Update(ctx context.Context, toUpdate policy.Policy) (string, error)
- func (r PolicyRepository) Upsert(ctx context.Context, pol policy.Policy) (policy.Policy, error)
- type Preference
- type PreferenceRepository
- func (s *PreferenceRepository) Get(ctx context.Context, id uuid.UUID) (preference.Preference, error)
- func (s *PreferenceRepository) List(ctx context.Context, flt preference.Filter) ([]preference.Preference, error)
- func (s *PreferenceRepository) Set(ctx context.Context, pref preference.Preference) (preference.Preference, error)
- type Price
- type Product
- type Project
- type ProjectRepository
- func (r ProjectRepository) Create(ctx context.Context, prj project.Project) (project.Project, error)
- func (r ProjectRepository) Delete(ctx context.Context, id string) error
- func (r ProjectRepository) GetByID(ctx context.Context, id string) (project.Project, error)
- func (r ProjectRepository) GetByName(ctx context.Context, name string) (project.Project, error)
- func (r ProjectRepository) List(ctx context.Context, flt project.Filter) ([]project.Project, error)
- func (r ProjectRepository) SetState(ctx context.Context, id string, state project.State) error
- func (r ProjectRepository) UpdateByID(ctx context.Context, prj project.Project) (project.Project, error)
- func (r ProjectRepository) UpdateByName(ctx context.Context, prj project.Project) (project.Project, error)
- type Relation
- type RelationRepository
- func (r RelationRepository) DeleteByID(ctx context.Context, id string) error
- func (r RelationRepository) Get(ctx context.Context, id string) (relation.Relation, error)
- func (r RelationRepository) GetByFields(ctx context.Context, rel relation.Relation) ([]relation.Relation, error)
- func (r RelationRepository) List(ctx context.Context, flt relation.Filter) ([]relation.Relation, error)
- func (r RelationRepository) ListByFields(ctx context.Context, rel relation.Relation) ([]relation.Relation, error)
- func (r RelationRepository) Upsert(ctx context.Context, relationToCreate relation.Relation) (relation.Relation, error)
- type Resource
- type ResourceCols
- type ResourceRepository
- func (r ResourceRepository) Create(ctx context.Context, res resource.Resource) (resource.Resource, error)
- func (r ResourceRepository) Delete(ctx context.Context, id string) error
- func (r ResourceRepository) GetByID(ctx context.Context, id string) (resource.Resource, error)
- func (r ResourceRepository) GetByURN(ctx context.Context, urn string) (resource.Resource, error)
- func (r ResourceRepository) List(ctx context.Context, flt resource.Filter) ([]resource.Resource, error)
- func (r ResourceRepository) Update(ctx context.Context, res resource.Resource) (resource.Resource, error)
- type Role
- type RoleRepository
- func (r RoleRepository) Delete(ctx context.Context, id string) error
- func (r RoleRepository) Get(ctx context.Context, id string) (role.Role, error)
- func (r RoleRepository) GetByName(ctx context.Context, orgID, name string) (role.Role, error)
- func (r RoleRepository) List(ctx context.Context, flt role.Filter) ([]role.Role, error)
- func (r RoleRepository) Update(ctx context.Context, rl role.Role) (role.Role, error)
- func (r RoleRepository) Upsert(ctx context.Context, rl role.Role) (role.Role, error)
- type ServiceUser
- type ServiceUserCredential
- type ServiceUserCredentialRepository
- func (s ServiceUserCredentialRepository) Create(ctx context.Context, credential serviceuser.Credential) (serviceuser.Credential, error)
- func (s ServiceUserCredentialRepository) Delete(ctx context.Context, id string) error
- func (s ServiceUserCredentialRepository) Get(ctx context.Context, id string) (serviceuser.Credential, error)
- func (s ServiceUserCredentialRepository) List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.Credential, error)
- type ServiceUserRepository
- func (s ServiceUserRepository) Create(ctx context.Context, serviceUser serviceuser.ServiceUser) (serviceuser.ServiceUser, error)
- func (s ServiceUserRepository) Delete(ctx context.Context, id string) error
- func (s ServiceUserRepository) GetByID(ctx context.Context, id string) (serviceuser.ServiceUser, error)
- func (s ServiceUserRepository) GetByIDs(ctx context.Context, ids []string) ([]serviceuser.ServiceUser, error)
- func (s ServiceUserRepository) List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.ServiceUser, error)
- type Session
- type SessionRepository
- func (s *SessionRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (s *SessionRepository) DeleteExpiredSessions(ctx context.Context) error
- func (s *SessionRepository) Get(ctx context.Context, id uuid.UUID) (*frontiersession.Session, error)
- func (s *SessionRepository) Set(ctx context.Context, session *frontiersession.Session) error
- func (s *SessionRepository) UpdateValidity(ctx context.Context, id uuid.UUID, validity time.Duration) error
- type Subscription
- type SubscriptionChanges
- type SubscriptionConfig
- type Tax
- type Transaction
- type User
- type UserRepository
- func (r UserRepository) Create(ctx context.Context, usr user.User) (user.User, error)
- func (r UserRepository) Delete(ctx context.Context, id string) error
- func (r UserRepository) GetByEmail(ctx context.Context, email string) (user.User, error)
- func (r UserRepository) GetByID(ctx context.Context, id string) (user.User, error)
- func (r UserRepository) GetByIDs(ctx context.Context, userIDs []string) ([]user.User, error)
- func (r UserRepository) GetByName(ctx context.Context, name string) (user.User, error)
- func (r UserRepository) List(ctx context.Context, flt user.Filter) ([]user.User, error)
- func (r UserRepository) SetState(ctx context.Context, id string, state user.State) error
- func (r UserRepository) UpdateByEmail(ctx context.Context, usr user.User) (user.User, error)
- func (r UserRepository) UpdateByID(ctx context.Context, usr user.User) (user.User, error)
- func (r UserRepository) UpdateByName(ctx context.Context, usr user.User) (user.User, error)
- type WebhookEndpoint
- type WebhookEndpointRepository
- func (r WebhookEndpointRepository) Create(ctx context.Context, toCreate webhook.Endpoint) (webhook.Endpoint, error)
- func (r WebhookEndpointRepository) Delete(ctx context.Context, id string) error
- func (r WebhookEndpointRepository) GetByID(ctx context.Context, id string) (webhook.Endpoint, error)
- func (r WebhookEndpointRepository) List(ctx context.Context, flt webhook.EndpointFilter) ([]webhook.Endpoint, error)
- func (r WebhookEndpointRepository) UpdateByID(ctx context.Context, toUpdate webhook.Endpoint) (webhook.Endpoint, error)
- type WebhookHeaders
- type WebhookSecret
- type WebhookSecrets
Constants ¶
const ( TABLE_PERMISSIONS = "permissions" TABLE_GROUPS = "groups" TABLE_NAMESPACES = "namespaces" TABLE_ORGANIZATIONS = "organizations" TABLE_POLICIES = "policies" TABLE_PROJECTS = "projects" TABLE_RELATIONS = "relations" TABLE_RESOURCES = "resources" TABLE_ROLES = "roles" TABLE_USERS = "users" TABLE_METASCHEMA = "metaschema" TABLE_FLOWS = "flows" TABLE_SESSIONS = "sessions" TABLE_INVITATIONS = "invitations" TABLE_SERVICEUSER = "serviceusers" TABLE_SERVICEUSERCREDENTIALS = "serviceuser_credentials" TABLE_AUDITLOGS = "auditlogs" TABLE_DOMAINS = "domains" TABLE_PREFERENCES = "preferences" TABLE_BILLING_CUSTOMERS = "billing_customers" TABLE_BILLING_PLANS = "billing_plans" TABLE_BILLING_PRODUCTS = "billing_products" TABLE_BILLING_PRICES = "billing_prices" TABLE_BILLING_FEATURES = "billing_features" TABLE_BILLING_SUBSCRIPTIONS = "billing_subscriptions" TABLE_BILLING_CHECKOUTS = "billing_checkouts" TABLE_BILLING_TRANSACTIONS = "billing_transactions" TABLE_BILLING_INVOICES = "billing_invoices" TABLE_WEBHOOK_ENDPOINTS = "webhook_endpoints" )
Variables ¶
var ( ErrDuplicateKey = errors.New("duplicate key") ErrCheckViolation = errors.New("check constraint violation") ErrForeignKeyViolation = errors.New("foreign key violation") ErrInvalidTextRepresentation = errors.New("invalid input syntax type") ErrInvalidID = errors.New("invalid id") )
var (
ErrInvalidSlug = fmt.Errorf("invalid slug")
)
Functions ¶
This section is empty.
Types ¶
type Audit ¶
type Audit struct { ID string `db:"id"` OrgID string `db:"org_id"` Source string `db:"source"` Action string `db:"action"` Actor types.NullJSONText `db:"actor"` Target types.NullJSONText `db:"target"` Metadata types.NullJSONText `db:"metadata"` CreatedAt time.Time `db:"created_at"` }
type AuditRepository ¶
type AuditRepository struct {
// contains filtered or unexported fields
}
func NewAuditRepository ¶
func NewAuditRepository(dbc *db.Client) *AuditRepository
type BehaviorConfig ¶ added in v0.8.18
type BehaviorConfig struct { CreditAmount int64 `json:"credit_amount"` SeatLimit int64 `json:"seat_limit"` MinQuantity int64 `json:"min_quantity"` MaxQuantity int64 `json:"max_quantity"` }
func (*BehaviorConfig) Scan ¶ added in v0.8.18
func (b *BehaviorConfig) Scan(src interface{}) error
type BillingCheckoutRepository ¶ added in v0.8.0
type BillingCheckoutRepository struct {
// contains filtered or unexported fields
}
func NewBillingCheckoutRepository ¶ added in v0.8.0
func NewBillingCheckoutRepository(dbc *db.Client) *BillingCheckoutRepository
func (BillingCheckoutRepository) UpdateByID ¶ added in v0.8.0
type BillingCustomerRepository ¶ added in v0.8.0
type BillingCustomerRepository struct {
// contains filtered or unexported fields
}
func NewBillingCustomerRepository ¶ added in v0.8.0
func NewBillingCustomerRepository(dbc *db.Client) *BillingCustomerRepository
func (BillingCustomerRepository) Delete ¶ added in v0.8.0
func (r BillingCustomerRepository) Delete(ctx context.Context, id string) error
func (BillingCustomerRepository) UpdateByID ¶ added in v0.8.0
type BillingFeatureRepository ¶ added in v0.8.0
type BillingFeatureRepository struct {
// contains filtered or unexported fields
}
func NewBillingFeatureRepository ¶ added in v0.8.0
func NewBillingFeatureRepository(dbc *db.Client) *BillingFeatureRepository
func (BillingFeatureRepository) UpdateByName ¶ added in v0.8.0
type BillingInvoiceRepository ¶ added in v0.8.26
type BillingInvoiceRepository struct {
// contains filtered or unexported fields
}
func NewBillingInvoiceRepository ¶ added in v0.8.26
func NewBillingInvoiceRepository(dbc *db.Client) *BillingInvoiceRepository
func (BillingInvoiceRepository) Delete ¶ added in v0.8.35
func (r BillingInvoiceRepository) Delete(ctx context.Context, id string) error
func (BillingInvoiceRepository) UpdateByID ¶ added in v0.8.26
type BillingPlanRepository ¶ added in v0.8.0
type BillingPlanRepository struct {
// contains filtered or unexported fields
}
func NewBillingPlanRepository ¶ added in v0.8.0
func NewBillingPlanRepository(dbc *db.Client) *BillingPlanRepository
func (BillingPlanRepository) UpdateByName ¶ added in v0.8.0
type BillingPriceRepository ¶ added in v0.8.0
type BillingPriceRepository struct {
// contains filtered or unexported fields
}
func NewBillingPriceRepository ¶ added in v0.8.0
func NewBillingPriceRepository(dbc *db.Client) *BillingPriceRepository
func (BillingPriceRepository) UpdateByID ¶ added in v0.8.0
type BillingProductRepository ¶ added in v0.8.14
type BillingProductRepository struct {
// contains filtered or unexported fields
}
func NewBillingProductRepository ¶ added in v0.8.14
func NewBillingProductRepository(dbc *db.Client) *BillingProductRepository
func (BillingProductRepository) UpdateByName ¶ added in v0.8.14
type BillingSubscriptionRepository ¶ added in v0.8.0
type BillingSubscriptionRepository struct {
// contains filtered or unexported fields
}
func NewBillingSubscriptionRepository ¶ added in v0.8.0
func NewBillingSubscriptionRepository(dbc *db.Client) *BillingSubscriptionRepository
func (BillingSubscriptionRepository) Create ¶ added in v0.8.0
func (r BillingSubscriptionRepository) Create(ctx context.Context, toCreate subscription.Subscription) (subscription.Subscription, error)
func (BillingSubscriptionRepository) Delete ¶ added in v0.8.35
func (r BillingSubscriptionRepository) Delete(ctx context.Context, id string) error
func (BillingSubscriptionRepository) GetByID ¶ added in v0.8.0
func (r BillingSubscriptionRepository) GetByID(ctx context.Context, id string) (subscription.Subscription, error)
func (BillingSubscriptionRepository) GetByName ¶ added in v0.8.0
func (r BillingSubscriptionRepository) GetByName(ctx context.Context, name string) (subscription.Subscription, error)
func (BillingSubscriptionRepository) GetByProviderID ¶ added in v0.8.0
func (r BillingSubscriptionRepository) GetByProviderID(ctx context.Context, id string) (subscription.Subscription, error)
func (BillingSubscriptionRepository) List ¶ added in v0.8.0
func (r BillingSubscriptionRepository) List(ctx context.Context, filter subscription.Filter) ([]subscription.Subscription, error)
func (BillingSubscriptionRepository) UpdateByID ¶ added in v0.8.0
func (r BillingSubscriptionRepository) UpdateByID(ctx context.Context, toUpdate subscription.Subscription) (subscription.Subscription, error)
type BillingTransactionRepository ¶ added in v0.8.0
type BillingTransactionRepository struct {
// contains filtered or unexported fields
}
func NewBillingTransactionRepository ¶ added in v0.8.0
func NewBillingTransactionRepository(dbc *db.Client) *BillingTransactionRepository
func (BillingTransactionRepository) CreateEntry ¶ added in v0.8.0
func (r BillingTransactionRepository) CreateEntry(ctx context.Context, debitEntry credit.Transaction, creditEntry credit.Transaction) ([]credit.Transaction, error)
func (BillingTransactionRepository) GetBalance ¶ added in v0.8.0
func (r BillingTransactionRepository) GetBalance(ctx context.Context, accountID string) (int64, error)
GetBalance currently sums all transactions for a customer and returns the balance. Ideally to speed this up we should create another table transaction_statement which will in batch compute the monthly summary for each customer, and then we can just query that table to get the balance since last month end date and add it to the entries in transaction table till now.
func (BillingTransactionRepository) GetByID ¶ added in v0.8.0
func (r BillingTransactionRepository) GetByID(ctx context.Context, id string) (credit.Transaction, error)
func (BillingTransactionRepository) List ¶ added in v0.8.0
func (r BillingTransactionRepository) List(ctx context.Context, filter credit.Filter) ([]credit.Transaction, error)
func (BillingTransactionRepository) UpdateByID ¶ added in v0.8.0
func (r BillingTransactionRepository) UpdateByID(ctx context.Context, toUpdate credit.Transaction) (credit.Transaction, error)
type Checkout ¶ added in v0.8.0
type Checkout struct { ID string `db:"id"` CustomerID string `db:"customer_id"` ProviderID string `db:"provider_id"` PlanID *string `db:"plan_id"` SubscriptionConfig SubscriptionConfig `db:"subscription_config"` FeatureID *string `db:"feature_id"` SuccessUrl *string `db:"success_url"` CancelUrl *string `db:"cancel_url"` CheckoutUrl string `db:"checkout_url"` PaymentStatus *string `db:"payment_status"` State string `db:"state"` Metadata types.NullJSONText `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` ExpireAt *time.Time `db:"expire_at"` }
type Customer ¶ added in v0.8.0
type Customer struct { ID string `db:"id"` OrgID string `db:"org_id"` ProviderID *string `db:"provider_id"` // this could be empty if the customer is created as offline Name string `db:"name"` Email string `db:"email"` Phone *string `db:"phone"` Currency string `db:"currency"` Address types.NullJSONText `db:"address"` Metadata types.NullJSONText `db:"metadata"` Tax Tax `db:"tax"` State string `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` }
type DomainRepository ¶ added in v0.7.2
func NewDomainRepository ¶ added in v0.7.2
func NewDomainRepository(logger log.Logger, dbc *db.Client) *DomainRepository
func (*DomainRepository) Delete ¶ added in v0.7.2
func (s *DomainRepository) Delete(ctx context.Context, id string) error
func (*DomainRepository) DeleteExpiredDomainRequests ¶ added in v0.7.2
func (s *DomainRepository) DeleteExpiredDomainRequests(ctx context.Context) error
type FlowRepository ¶
func NewFlowRepository ¶
func NewFlowRepository(logger log.Logger, dbc *db.Client) *FlowRepository
func (*FlowRepository) DeleteExpiredFlows ¶
func (s *FlowRepository) DeleteExpiredFlows(ctx context.Context) error
func (*FlowRepository) Get ¶
func (s *FlowRepository) Get(ctx context.Context, id uuid.UUID) (*authenticate.Flow, error)
func (*FlowRepository) Set ¶
func (s *FlowRepository) Set(ctx context.Context, flow *authenticate.Flow) error
type Group ¶
type Group struct { ID string `db:"id"` Name string `db:"name"` Title sql.NullString `db:"title"` OrgID string `db:"org_id"` Metadata []byte `db:"metadata"` State sql.NullString `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type GroupRepository ¶
type GroupRepository struct {
// contains filtered or unexported fields
}
func NewGroupRepository ¶
func NewGroupRepository(dbc *db.Client) *GroupRepository
func (GroupRepository) Delete ¶
func (r GroupRepository) Delete(ctx context.Context, id string) error
func (GroupRepository) ListGroupRelations ¶
func (r GroupRepository) ListGroupRelations(ctx context.Context, objectId string, subject_type string, role string) ([]relation.Relation, error)
TODO(kushsharma): no longer in use, delete if needed
func (GroupRepository) UpdateByID ¶
type Invitation ¶
type InvitationRepository ¶
func NewInvitationRepository ¶
func NewInvitationRepository(logger log.Logger, dbc *db.Client) *InvitationRepository
func (*InvitationRepository) GarbageCollect ¶
func (s *InvitationRepository) GarbageCollect(ctx context.Context) error
TODO(kushsharma): schedue a cron for it
func (*InvitationRepository) Get ¶
func (s *InvitationRepository) Get(ctx context.Context, id uuid.UUID) (invitation.Invitation, error)
func (*InvitationRepository) List ¶
func (s *InvitationRepository) List(ctx context.Context, flt invitation.Filter) ([]invitation.Invitation, error)
func (*InvitationRepository) ListByUser ¶
func (s *InvitationRepository) ListByUser(ctx context.Context, id string) ([]invitation.Invitation, error)
func (*InvitationRepository) Set ¶
func (s *InvitationRepository) Set(ctx context.Context, invite invitation.Invitation) (invitation.Invitation, error)
type Invoice ¶ added in v0.8.26
type Invoice struct { ID string `db:"id"` ProviderID string `db:"provider_id"` CustomerID string `db:"customer_id"` State string `db:"state"` Currency string `db:"currency"` Amount int64 `db:"amount"` HostedURL string `db:"hosted_url"` Metadata types.NullJSONText `db:"metadata"` PeriodStartAt *time.Time `db:"period_start_at"` PeriodEndAt *time.Time `db:"period_end_at"` DueAt *time.Time `db:"due_at"` EffectiveAt *time.Time `db:"effective_at"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` }
type MetaSchema ¶
type MetaSchemaRepository ¶
type MetaSchemaRepository struct {
// contains filtered or unexported fields
}
func NewMetaSchemaRepository ¶
func NewMetaSchemaRepository(logger log.Logger, dbc *db.Client) *MetaSchemaRepository
func (MetaSchemaRepository) Create ¶
func (m MetaSchemaRepository) Create(ctx context.Context, mschema metaschema.MetaSchema) (metaschema.MetaSchema, error)
func (MetaSchemaRepository) Get ¶
func (m MetaSchemaRepository) Get(ctx context.Context, id string) (metaschema.MetaSchema, error)
func (MetaSchemaRepository) List ¶
func (m MetaSchemaRepository) List(ctx context.Context) ([]metaschema.MetaSchema, error)
func (MetaSchemaRepository) MigrateDefaults ¶
func (m MetaSchemaRepository) MigrateDefaults(ctx context.Context) error
add default schemas to db once during database migration
func (MetaSchemaRepository) Update ¶
func (m MetaSchemaRepository) Update(ctx context.Context, id string, mschema metaschema.MetaSchema) (metaschema.MetaSchema, error)
type NamespaceRepository ¶
type NamespaceRepository struct {
// contains filtered or unexported fields
}
func NewNamespaceRepository ¶
func NewNamespaceRepository(dbc *db.Client) *NamespaceRepository
type Organization ¶
type Organization struct { ID string `db:"id"` Name string `db:"name"` Title sql.NullString `db:"title"` Avatar sql.NullString `db:"avatar"` Metadata []byte `db:"metadata"` State sql.NullString `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type OrganizationRepository ¶
type OrganizationRepository struct {
// contains filtered or unexported fields
}
func NewOrganizationRepository ¶
func NewOrganizationRepository(dbc *db.Client) *OrganizationRepository
func (OrganizationRepository) Create ¶
func (r OrganizationRepository) Create(ctx context.Context, org organization.Organization) (organization.Organization, error)
func (OrganizationRepository) Delete ¶
func (r OrganizationRepository) Delete(ctx context.Context, id string) error
func (OrganizationRepository) GetByID ¶
func (r OrganizationRepository) GetByID(ctx context.Context, id string) (organization.Organization, error)
func (OrganizationRepository) GetByIDs ¶
func (r OrganizationRepository) GetByIDs(ctx context.Context, ids []string) ([]organization.Organization, error)
func (OrganizationRepository) GetByName ¶
func (r OrganizationRepository) GetByName(ctx context.Context, name string) (organization.Organization, error)
func (OrganizationRepository) List ¶
func (r OrganizationRepository) List(ctx context.Context, flt organization.Filter) ([]organization.Organization, error)
func (OrganizationRepository) SetState ¶
func (r OrganizationRepository) SetState(ctx context.Context, id string, state organization.State) error
func (OrganizationRepository) UpdateByID ¶
func (r OrganizationRepository) UpdateByID(ctx context.Context, org organization.Organization) (organization.Organization, error)
func (OrganizationRepository) UpdateByName ¶
func (r OrganizationRepository) UpdateByName(ctx context.Context, org organization.Organization) (organization.Organization, error)
type Permission ¶
type PermissionRepository ¶
type PermissionRepository struct {
// contains filtered or unexported fields
}
func NewPermissionRepository ¶
func NewPermissionRepository(dbc *db.Client) *PermissionRepository
func (PermissionRepository) Delete ¶
func (r PermissionRepository) Delete(ctx context.Context, id string) error
func (PermissionRepository) Get ¶
func (r PermissionRepository) Get(ctx context.Context, id string) (permission.Permission, error)
func (PermissionRepository) GetBySlug ¶
func (r PermissionRepository) GetBySlug(ctx context.Context, slug string) (permission.Permission, error)
func (PermissionRepository) List ¶
func (r PermissionRepository) List(ctx context.Context, flt permission.Filter) ([]permission.Permission, error)
func (PermissionRepository) Update ¶
func (r PermissionRepository) Update(ctx context.Context, act permission.Permission) (permission.Permission, error)
func (PermissionRepository) Upsert ¶
func (r PermissionRepository) Upsert(ctx context.Context, perm permission.Permission) (permission.Permission, error)
type Plan ¶ added in v0.8.0
type Plan struct { ID string `db:"id"` Name string `db:"name"` Title *string `db:"title"` Description *string `db:"description"` Interval *string `db:"interval"` OnStartCredits int64 `db:"on_start_credits"` State string `db:"state"` TrialDays *int64 `db:"trial_days"` Metadata types.NullJSONText `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` }
type Policy ¶
type Policy struct { ID string `db:"id"` Role Role RoleID string `db:"role_id"` ResourceID string `db:"resource_id"` ResourceType string `db:"resource_type"` PrincipalID string `db:"principal_id"` PrincipalType string `db:"principal_type"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type PolicyCols ¶
type PolicyCols struct { ID string `db:"id"` RoleID string `db:"role_id"` ResourceType string `db:"resource_type"` ResourceID string `db:"resource_id"` PrincipalID string `db:"principal_id"` PrincipalType string `db:"principal_type"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type PolicyRepository ¶
type PolicyRepository struct {
// contains filtered or unexported fields
}
func NewPolicyRepository ¶
func NewPolicyRepository(dbc *db.Client) *PolicyRepository
func (PolicyRepository) Delete ¶
func (r PolicyRepository) Delete(ctx context.Context, id string) error
func (PolicyRepository) GroupMemberCount ¶ added in v0.8.8
func (r PolicyRepository) GroupMemberCount(ctx context.Context, groupIDs []string) ([]policy.MemberCount, error)
func (PolicyRepository) OrgMemberCount ¶ added in v0.8.13
func (r PolicyRepository) OrgMemberCount(ctx context.Context, id string) (policy.MemberCount, error)
func (PolicyRepository) ProjectMemberCount ¶ added in v0.8.8
func (r PolicyRepository) ProjectMemberCount(ctx context.Context, projectIDs []string) ([]policy.MemberCount, error)
type Preference ¶ added in v0.7.3
type PreferenceRepository ¶ added in v0.7.3
type PreferenceRepository struct {
// contains filtered or unexported fields
}
func NewPreferenceRepository ¶ added in v0.7.3
func NewPreferenceRepository(dbc *db.Client) *PreferenceRepository
func (*PreferenceRepository) Get ¶ added in v0.7.3
func (s *PreferenceRepository) Get(ctx context.Context, id uuid.UUID) (preference.Preference, error)
func (*PreferenceRepository) List ¶ added in v0.7.3
func (s *PreferenceRepository) List(ctx context.Context, flt preference.Filter) ([]preference.Preference, error)
func (*PreferenceRepository) Set ¶ added in v0.7.3
func (s *PreferenceRepository) Set(ctx context.Context, pref preference.Preference) (preference.Preference, error)
type Price ¶ added in v0.8.0
type Price struct { ID string `db:"id"` ProductID string `db:"product_id"` ProviderID string `db:"provider_id"` Name string `db:"name"` BillingScheme string `db:"billing_scheme"` Currency string `db:"currency"` Amount int64 `db:"amount"` Interval string `db:"interval"` UsageType string `db:"usage_type"` MeteredAggregate *string `db:"metered_aggregate"` TierMode *string `db:"tier_mode"` State string `db:"state"` Metadata types.NullJSONText `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` }
type Product ¶ added in v0.8.14
type Product struct { ID string `db:"id"` ProviderID string `db:"provider_id"` PlanIDs pq.StringArray `db:"plan_ids"` Name string `db:"name"` Title *string `db:"title"` Description *string `db:"description"` Behavior string `db:"behavior"` Config BehaviorConfig `db:"config"` State string `db:"state"` Metadata types.NullJSONText `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` }
type Project ¶
type Project struct { ID string `db:"id"` Name string `db:"name"` Title sql.NullString `db:"title"` OrgID string `db:"org_id"` Metadata []byte `db:"metadata"` State sql.NullString `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type ProjectRepository ¶
type ProjectRepository struct {
// contains filtered or unexported fields
}
func NewProjectRepository ¶
func NewProjectRepository(dbc *db.Client) *ProjectRepository
func (ProjectRepository) Delete ¶
func (r ProjectRepository) Delete(ctx context.Context, id string) error
func (ProjectRepository) UpdateByID ¶
func (ProjectRepository) UpdateByName ¶
type Relation ¶
type Relation struct { ID string `db:"id"` SubjectNamespaceID string `db:"subject_namespace_name"` SubjectNamespace Namespace `db:"subject_namespace"` SubjectID string `db:"subject_id"` SubjectSubRelationID sql.NullString `db:"subject_subrelation_name"` ObjectNamespaceID string `db:"object_namespace_name"` ObjectNamespace Namespace `db:"object_namespace"` ObjectID string `db:"object_id"` RelationName string `db:"relation_name"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type RelationRepository ¶
type RelationRepository struct {
// contains filtered or unexported fields
}
func NewRelationRepository ¶
func NewRelationRepository(dbc *db.Client) *RelationRepository
func (RelationRepository) DeleteByID ¶
func (r RelationRepository) DeleteByID(ctx context.Context, id string) error
func (RelationRepository) GetByFields ¶
func (RelationRepository) ListByFields ¶
type Resource ¶
type Resource struct { ID string `db:"id"` URN string `db:"urn"` Name string `db:"name"` Title string `db:"title"` ProjectID string `db:"project_id"` Project Project `db:"project"` Metadata []byte `db:"metadata"` NamespaceID string `db:"namespace_name"` Namespace Namespace `db:"namespace"` PrincipalID sql.NullString `db:"principal_id"` PrincipalType sql.NullString `db:"principal_type"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type ResourceCols ¶
type ResourceCols struct { ID string `db:"id"` URN string `db:"urn"` Title string `db:"title"` Name string `db:"name"` ProjectID string `db:"project_id"` NamespaceID string `db:"namespace_name"` PrincipalID sql.NullString `db:"principal_id"` PrincipalType sql.NullString `db:"principal_type"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type ResourceRepository ¶
type ResourceRepository struct {
// contains filtered or unexported fields
}
func NewResourceRepository ¶
func NewResourceRepository(dbc *db.Client) *ResourceRepository
func (ResourceRepository) Delete ¶
func (r ResourceRepository) Delete(ctx context.Context, id string) error
type Role ¶
type Role struct { ID string `db:"id"` OrgID string `db:"org_id"` Name string `db:"name"` Title sql.NullString `db:"title"` Permissions []byte `db:"permissions"` State string `db:"state"` Scopes pq.StringArray `db:"scopes"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type RoleRepository ¶
type RoleRepository struct {
// contains filtered or unexported fields
}
func NewRoleRepository ¶
func NewRoleRepository(dbc *db.Client) *RoleRepository
type ServiceUser ¶
type ServiceUserCredential ¶
type ServiceUserCredential struct { ID string `db:"id"` ServiceUserID string `db:"serviceuser_id"` Type sql.NullString `db:"type"` SecretHash sql.NullString `db:"secret_hash"` PublicKey []byte `db:"public_key"` Title sql.NullString `db:"title"` Metadata []byte `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type ServiceUserCredentialRepository ¶
type ServiceUserCredentialRepository struct {
// contains filtered or unexported fields
}
func NewServiceUserCredentialRepository ¶
func NewServiceUserCredentialRepository(dbc *db.Client) *ServiceUserCredentialRepository
func (ServiceUserCredentialRepository) Create ¶
func (s ServiceUserCredentialRepository) Create(ctx context.Context, credential serviceuser.Credential) (serviceuser.Credential, error)
func (ServiceUserCredentialRepository) Delete ¶
func (s ServiceUserCredentialRepository) Delete(ctx context.Context, id string) error
func (ServiceUserCredentialRepository) Get ¶
func (s ServiceUserCredentialRepository) Get(ctx context.Context, id string) (serviceuser.Credential, error)
func (ServiceUserCredentialRepository) List ¶
func (s ServiceUserCredentialRepository) List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.Credential, error)
type ServiceUserRepository ¶
type ServiceUserRepository struct {
// contains filtered or unexported fields
}
func NewServiceUserRepository ¶
func NewServiceUserRepository(dbc *db.Client) *ServiceUserRepository
func (ServiceUserRepository) Create ¶
func (s ServiceUserRepository) Create(ctx context.Context, serviceUser serviceuser.ServiceUser) (serviceuser.ServiceUser, error)
func (ServiceUserRepository) Delete ¶
func (s ServiceUserRepository) Delete(ctx context.Context, id string) error
func (ServiceUserRepository) GetByID ¶
func (s ServiceUserRepository) GetByID(ctx context.Context, id string) (serviceuser.ServiceUser, error)
func (ServiceUserRepository) GetByIDs ¶
func (s ServiceUserRepository) GetByIDs(ctx context.Context, ids []string) ([]serviceuser.ServiceUser, error)
GetByIDs returns a list of service users by their IDs.
func (ServiceUserRepository) List ¶
func (s ServiceUserRepository) List(ctx context.Context, flt serviceuser.Filter) ([]serviceuser.ServiceUser, error)
type SessionRepository ¶
func NewSessionRepository ¶
func NewSessionRepository(logger log.Logger, dbc *db.Client) *SessionRepository
func (*SessionRepository) DeleteExpiredSessions ¶
func (s *SessionRepository) DeleteExpiredSessions(ctx context.Context) error
func (*SessionRepository) Get ¶
func (s *SessionRepository) Get(ctx context.Context, id uuid.UUID) (*frontiersession.Session, error)
func (*SessionRepository) Set ¶
func (s *SessionRepository) Set(ctx context.Context, session *frontiersession.Session) error
func (*SessionRepository) UpdateValidity ¶
type Subscription ¶ added in v0.8.0
type Subscription struct { ID string `db:"id"` ProviderID string `db:"provider_id"` SubscriptionID string `db:"customer_id"` PlanID string `db:"plan_id"` State string `db:"state"` Metadata types.NullJSONText `db:"metadata"` Changes SubscriptionChanges `db:"changes"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` CanceledAt *time.Time `db:"canceled_at"` EndedAt *time.Time `db:"ended_at"` DeletedAt *time.Time `db:"deleted_at"` TrialEndsAt *time.Time `db:"trial_ends_at"` CurrentPeriodStartAt *time.Time `db:"current_period_start_at"` CurrentPeriodEndAt *time.Time `db:"current_period_end_at"` BillingCycleAnchorAt *time.Time `db:"billing_cycle_anchor_at"` }
type SubscriptionChanges ¶ added in v0.8.19
type SubscriptionChanges struct { Phases []Phase `json:"phases"` PlanHistory []Phase `json:"plan_history"` }
func (*SubscriptionChanges) Scan ¶ added in v0.8.19
func (c *SubscriptionChanges) Scan(src interface{}) error
type SubscriptionConfig ¶ added in v0.8.30
type SubscriptionConfig struct { SkipTrial bool `db:"skip_trial" json:"skip_trial"` CancelAfterTrial bool `db:"cancel_after_trial" json:"cancel_after_trial"` }
func (*SubscriptionConfig) Scan ¶ added in v0.8.30
func (s *SubscriptionConfig) Scan(src interface{}) error
type Transaction ¶ added in v0.8.0
type Transaction struct { ID string `db:"id"` AccountID string `db:"account_id"` Amount int64 `db:"amount"` Type string `db:"type"` Source string `db:"source"` Description string `db:"description"` UserID *string `db:"user_id"` Metadata types.NullJSONText `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
Transaction represents a transaction entry in the database. A transaction can be of type credit or debit, every change creates two entry in records. At the moment transfer of funds are only between customer account and system account, we don't need a transaction id. If we do to support transfer of amount between more than two accounts we can add a transaction id which will be same for all entries in a single transaction.
type User ¶
type User struct { ID string `db:"id"` Name string `db:"name"` Email string `db:"email"` Title sql.NullString `db:"title"` Avatar sql.NullString `db:"avatar"` Metadata []byte `db:"metadata"` State sql.NullString `db:"state"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt sql.NullTime `db:"deleted_at"` }
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(dbc *db.Client) *UserRepository
func (UserRepository) GetByEmail ¶
func (UserRepository) UpdateByEmail ¶
func (UserRepository) UpdateByID ¶
func (UserRepository) UpdateByName ¶
type WebhookEndpoint ¶ added in v0.11.0
type WebhookEndpoint struct { ID string `db:"id"` Description *string `db:"description"` SubscribedEvents pq.StringArray `db:"subscribed_events"` Headers WebhookHeaders `db:"headers"` Url string `db:"url"` Secrets string `db:"secrets"` State string `db:"state"` Metadata types.NullJSONText `db:"metadata"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type WebhookEndpointRepository ¶ added in v0.11.0
type WebhookEndpointRepository struct {
// contains filtered or unexported fields
}
func NewWebhookEndpointRepository ¶ added in v0.11.0
func NewWebhookEndpointRepository(dbc *db.Client, encryptionKey []byte) *WebhookEndpointRepository
func (WebhookEndpointRepository) Delete ¶ added in v0.11.0
func (r WebhookEndpointRepository) Delete(ctx context.Context, id string) error
func (WebhookEndpointRepository) List ¶ added in v0.11.0
func (r WebhookEndpointRepository) List(ctx context.Context, flt webhook.EndpointFilter) ([]webhook.Endpoint, error)
func (WebhookEndpointRepository) UpdateByID ¶ added in v0.11.0
type WebhookHeaders ¶ added in v0.11.0
func (*WebhookHeaders) Scan ¶ added in v0.11.0
func (s *WebhookHeaders) Scan(src interface{}) error
type WebhookSecret ¶ added in v0.11.0
type WebhookSecrets ¶ added in v0.11.0
type WebhookSecrets struct {
Items []WebhookSecret `json:"items"`
}
Source Files ¶
- audit.go
- audit_repository.go
- billing_checkout_repository.go
- billing_customer_repository.go
- billing_feature_repository.go
- billing_invoice_repository.go
- billing_plan_repository.go
- billing_price_repository.go
- billing_product_repository.go
- billing_subscription_repository.go
- billing_transactions_repository.go
- domain.go
- domain_repository.go
- errors.go
- flow.go
- flow_repository.go
- group.go
- group_repository.go
- invitation.go
- invitation_repository.go
- metaschema.go
- metaschema_repository.go
- namespace.go
- namespace_repository.go
- organization.go
- organization_repository.go
- permission.go
- permission_repository.go
- policy.go
- policy_repository.go
- postgres.go
- preference.go
- preference_repository.go
- project.go
- project_repository.go
- relation.go
- relation_repository.go
- resource.go
- resource_repository.go
- role.go
- role_repository.go
- serviceuser.go
- serviceuser_credential_repository.go
- serviceuser_repository.go
- session.go
- session_repository.go
- user.go
- user_repository.go
- webhook_endpoint.go
- webhook_endpoint_repository.go