sql

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIToken

type APIToken struct {
	ProjectID string `json:"project_id"`

	Name   string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" firestore:"name,omitempty"`
	Token  string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty" firestore:"token,omitempty"`
	Role   string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty" firestore:"role,omitempty"`
	Expire string `protobuf:"bytes,4,opt,name=expire,proto3" json:"expire,omitempty" firestore:"expire,omitempty"`
}

type AddOnsDetails

type AddOnsDetails struct {
	ProjectID string `json:"project_id"`

	Locals             []string `protobuf:"bytes,1,rep,name=locals,proto3" json:"locals,omitempty" firestore:"locals,omitempty"`
	SystemGraphqlHooks bool     `` /* 161-byte string literal not displayed */
	RevisionHistory    bool     `` /* 146-byte string literal not displayed */
	EnableAuth         bool     `protobuf:"bytes,4,opt,name=enable_auth,proto3" json:"enable_auth,omitempty" firestore:"enable_auth,omitempty"`
}

type DriverCredentials

type DriverCredentials struct {
	ProjectID string `json:"project_id"`

	Engine   string `protobuf:"bytes,1,opt,name=engine,proto3" json:"engine,omitempty"`
	Host     string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	Port     string `protobuf:"bytes,3,opt,name=port,proto3" json:"port,omitempty"`
	User     string `protobuf:"bytes,4,opt,name=user,proto3" json:"user,omitempty"`
	Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
	Database string `protobuf:"bytes,6,opt,name=database,proto3" json:"database,omitempty"`
	// for firebase
	FirebaseProjectId             string `protobuf:"bytes,7,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	FirebaseProjectCredentialJson string `` /* 126-byte string literal not displayed */
	// for dynamodb
	AccessKey string `protobuf:"bytes,9,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"`
	SecretKey string `protobuf:"bytes,10,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"`
}

type PostgreSQLDriver

type PostgreSQLDriver struct {
	Gorm             *gorm.DB
	DriverCredential *protobuff.DriverCredentials
}

func GetSystemSQLDriver

func GetSystemSQLDriver(driverCredentials *protobuff.DriverCredentials) (*PostgreSQLDriver, error)

func (PostgreSQLDriver) AddATeamMemberToProject

func (p PostgreSQLDriver) AddATeamMemberToProject(ctx context.Context, projectId string, memberData map[string]interface{}) error

func (PostgreSQLDriver) AddSystemUserMetaInfo

func (PostgreSQLDriver) AddTeamMetaInfo

func (p PostgreSQLDriver) AddTeamMetaInfo(ctx context.Context, docs []*protobuff.SystemUser) ([]*protobuff.SystemUser, error)

func (PostgreSQLDriver) BlacklistAToken

func (p PostgreSQLDriver) BlacklistAToken(ctx context.Context, token map[string]interface{}) error

func (PostgreSQLDriver) CheckProjectName

func (p PostgreSQLDriver) CheckProjectName(ctx context.Context, name string) error

func (PostgreSQLDriver) CheckTokenBlacklisted

func (p PostgreSQLDriver) CheckTokenBlacklisted(ctx context.Context, tokenId string) error

func (PostgreSQLDriver) CreateProject

func (p PostgreSQLDriver) CreateProject(ctx context.Context, project *protobuff.Project) (*protobuff.Project, error)

func (PostgreSQLDriver) CreateSystemUser

func (p PostgreSQLDriver) CreateSystemUser(ctx context.Context, user *protobuff.SystemUser) (*protobuff.SystemUser, error)

func (PostgreSQLDriver) DeleteProjectFromSystem

func (p PostgreSQLDriver) DeleteProjectFromSystem(ctx context.Context, projectId string) error

func (PostgreSQLDriver) DeleteWebhook

func (p PostgreSQLDriver) DeleteWebhook(ctx context.Context, projectId, hookId string) error

func (PostgreSQLDriver) FindOrganizationAdmin

func (p PostgreSQLDriver) FindOrganizationAdmin(ctx context.Context, orgId string) (*protobuff.SystemUser, error)

func (PostgreSQLDriver) GetATeamMemberFromProject

func (p PostgreSQLDriver) GetATeamMemberFromProject(ctx context.Context, projectId string, memberID string) error

func (PostgreSQLDriver) GetOrganizations

func (PostgreSQLDriver) GetProject

func (p PostgreSQLDriver) GetProject(ctx context.Context, id string) (*protobuff.Project, error)

func (PostgreSQLDriver) GetSystemUser

func (p PostgreSQLDriver) GetSystemUser(ctx context.Context, id string) (*protobuff.SystemUser, error)

func (PostgreSQLDriver) GetSystemUserByEmail

func (p PostgreSQLDriver) GetSystemUserByEmail(ctx context.Context, email string) (*protobuff.SystemUser, error)

func (PostgreSQLDriver) GetSystemUserByUsername

func (p PostgreSQLDriver) GetSystemUserByUsername(ctx context.Context, username string) (*protobuff.SystemUser, error)

func (PostgreSQLDriver) GetSystemUsers

func (p PostgreSQLDriver) GetSystemUsers(ctx context.Context, keys []string) (map[string]*protobuff.SystemUser, error)

func (PostgreSQLDriver) ListAllProjects

func (p PostgreSQLDriver) ListAllProjects(ctx context.Context, userId string) ([]*protobuff.Project, error)

func (PostgreSQLDriver) ListAllUsers

func (p PostgreSQLDriver) ListAllUsers(ctx context.Context) ([]*protobuff.SystemUser, error)

func (PostgreSQLDriver) ListFunctions

func (PostgreSQLDriver) ListProjects

func (PostgreSQLDriver) ListTeams

func (p PostgreSQLDriver) ListTeams(ctx context.Context, projectId string) ([]*protobuff.SystemUser, error)

func (PostgreSQLDriver) RemoveATeamMemberFromProject

func (p PostgreSQLDriver) RemoveATeamMemberFromProject(ctx context.Context, projectId string, memberID string) error

func (PostgreSQLDriver) RunMigration

func (p PostgreSQLDriver) RunMigration() error

func (PostgreSQLDriver) SaveRawData

func (p PostgreSQLDriver) SaveRawData(ctx context.Context, collection string, data map[string]interface{}) error

func (PostgreSQLDriver) SearchResource

func (PostgreSQLDriver) SearchUsers

func (PostgreSQLDriver) UpdateProject

func (p PostgreSQLDriver) UpdateProject(ctx context.Context, project *protobuff.Project, replace bool) error

func (PostgreSQLDriver) UpdateSystemUser

func (p PostgreSQLDriver) UpdateSystemUser(ctx context.Context, user *protobuff.SystemUser, replace bool) error

type Project

type Project struct {
	XKey               string             `protobuf:"bytes,1,opt,name=_key,json=Key,proto3" json:"_key,omitempty" firestore:"_key,omitempty"`
	Id                 string             `gorm:"primaryKey;autoIncrement:false" protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty" firestore:"id,omitempty"`
	ProjectName        string             `` /* 129-byte string literal not displayed */
	ProjectDescription string             `` /* 157-byte string literal not displayed */
	Schema             datatypes.JSONMap  `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty" firestore:"schema,omitempty"`
	CreatedAt          string             `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty" firestore:"created_at,omitempty"`
	UpdatedAt          string             `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty" firestore:"updated_at,omitempty"`
	ExpireAt           string             `protobuf:"bytes,8,opt,name=expire_at,json=expireAt,proto3" json:"expire_at,omitempty" firestore:"expire_at,omitempty"`
	Plugins            datatypes.JSONMap  `` /* 185-byte string literal not displayed */
	Addons             *AddOnsDetails     `protobuf:"bytes,10,opt,name=addons,proto3" json:"addons,omitempty" firestore:"addons,omitempty"`
	Tokens             []*APIToken        `gorm:"foreignKey:ProjectID" protobuf:"bytes,11,rep,name=tokens,proto3" json:"tokens,omitempty" firestore:"tokens,omitempty"`
	Roles              datatypes.JSONMap  `` /* 180-byte string literal not displayed */
	Driver             *DriverCredentials `gorm:"foreignKey:ProjectID" protobuf:"bytes,13,opt,name=driver,proto3" json:"driver,omitempty" firestore:"driver,omitempty"`
	TempBanned         bool               `` /* 127-byte string literal not displayed */
	Plan               string             `protobuf:"bytes,15,opt,name=plan,proto3" json:"plan,omitempty" firestore:"plan,omitempty"`
	TrialEnds          string             `protobuf:"bytes,16,opt,name=trial_ends,json=trialEnds,proto3" json:"trial_ends,omitempty" firestore:"trial_ends,omitempty"`
	FromExample        string             `` /* 130-byte string literal not displayed */
	Limits             *UsagesTracking    `gorm:"foreignKey:ProjectID" protobuf:"bytes,18,opt,name=limits,proto3" json:"limits,omitempty" firestore:"limits,omitempty"`
}

Project user project

type UsagesTracking

type UsagesTracking struct {
	ProjectID string `json:"project_id"`

	ApiCalls        uint32  `protobuf:"varint,1,opt,name=api_calls,json=apiCalls,proto3" json:"api_calls,omitempty" firestore:"api_calls,omitempty"`
	ApiBandwidth    float64 `` /* 135-byte string literal not displayed */
	MediaStorage    float64 `` /* 135-byte string literal not displayed */
	MediaBandwidth  float64 `` /* 143-byte string literal not displayed */
	NumberOfMedia   float64 `` /* 142-byte string literal not displayed */
	NumberOfRecords float64 `` /* 150-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL