Documentation ¶
Index ¶
- Constants
- Variables
- func ForEachNamespace(applyFn func(ctx context.Context) (string, error))
- func GetManagementConsoleURL(ctx context.Context) (string, error)
- func GetManagementHost(ctx context.Context) (string, error)
- func Injector(next http.Handler) http.Handler
- func IsNonSaaSDeployment() bool
- func Neo4jClient(ctx context.Context) (neo4j.Driver, error)
- func NewContextWithNameSpace(ns NamespaceID) context.Context
- func NewGlobalContext() context.Context
- func NewSqlConnection(ctx context.Context) (*sql.DB, error)
- func PostgresClient(ctx context.Context) (*postgresqlDb.Queries, error)
- func RedisClient(ctx context.Context) (*redis.Client, error)
- func WithDatabaseContext(ctx context.Context) context.Context
- func WithGlobalContext(ctx context.Context) context.Context
- type AlreadyPresentError
- type CypherDriver
- func (cd CypherDriver) Close() error
- func (cd CypherDriver) NewSession(config neo4j.SessionConfig) neo4j.Session
- func (cd CypherDriver) Session(accessMode neo4j.AccessMode, bookmarks ...string) (neo4j.Session, error)
- func (cd CypherDriver) Target() url.URL
- func (cd CypherDriver) VerifyConnectivity() error
- type CypherSession
- func (cs CypherSession) BeginTransaction(configurers ...func(*neo4j.TransactionConfig)) (neo4j.Transaction, error)
- func (cs CypherSession) Close() error
- func (cs CypherSession) LastBookmark() string
- func (cs CypherSession) ReadTransaction(work neo4j.TransactionWork, configurers ...func(*neo4j.TransactionConfig)) (interface{}, error)
- func (cs CypherSession) Run(cypher string, params map[string]interface{}, ...) (neo4j.Result, error)
- func (cs CypherSession) WriteTransaction(work neo4j.TransactionWork, configurers ...func(*neo4j.TransactionConfig)) (interface{}, error)
- type CypherTransaction
- type DBConfigs
- type FileDeleteError
- type FileManager
- type MinioConfig
- type MinioFileManager
- func (mfm *MinioFileManager) Bucket() string
- func (mfm *MinioFileManager) CleanNamespace(ctx context.Context) error
- func (mfm *MinioFileManager) Client() interface{}
- func (mfm *MinioFileManager) CreatePublicBucket(ctx context.Context, bucket string) error
- func (mfm *MinioFileManager) CreatePublicUploadURL(ctx context.Context, filePath string, addFilePathPrefix bool, ...) (string, error)
- func (mfm *MinioFileManager) DeleteFile(ctx context.Context, filePath string, addFilePathPrefix bool, ...) error
- func (mfm *MinioFileManager) DownloadFile(ctx context.Context, remoteFile string, localFile string, extra interface{}) error
- func (mfm *MinioFileManager) DownloadFileContexts(ctx context.Context, remoteFile string, extra interface{}) ([]byte, error)
- func (mfm *MinioFileManager) DownloadFileTo(ctx context.Context, remoteFile string, writer io.WriteCloser, ...) error
- func (mfm *MinioFileManager) ExposeFile(ctx context.Context, filePath string, addFilePathPrefix bool, ...) (string, error)
- func (mfm *MinioFileManager) ListFiles(ctx context.Context, pathPrefix string, recursive bool, maxKeys int, ...) []ObjectInfo
- func (mfm *MinioFileManager) UploadFile(ctx context.Context, filename string, data []byte, overwrite bool, ...) (UploadResult, error)
- func (mfm *MinioFileManager) UploadLocalFile(ctx context.Context, filename string, localFilename string, overwrite bool, ...) (UploadResult, error)
- type NamespaceID
- type Neo4jConfig
- type ObjectInfo
- type PathDoesNotExistsError
- type PostgresqlConfig
- type RedisConfig
- type SettingValue
- type UploadResult
- type WorkEnqueuer
Constants ¶
View Source
const ( GlobalDirKey = NamespaceID("global") NonSaaSDirKey = NamespaceID("default") DatabaseDirKey = NamespaceID("database") NamespaceKey = "namespace" )
View Source
const (
ConsoleURLSettingKey = "console_url"
)
Variables ¶
View Source
var ( MinioBucket = utils.GetEnvOrDefault("TOAE_MINIO_BUCKET", string(NonSaaSDirKey)) MinioDatabaseBucket = utils.GetEnvOrDefault("TOAE_MINIO_DB_BUCKET", string(DatabaseDirKey)) )
View Source
var ErrDatabaseConfigNotFound = errors.New("database config not found")
View Source
var ErrExhaustedResources = errors.New("Exhausted worker resources")
View Source
var ErrNamespaceNotFound = errors.New("namespace/tenet-id not found")
Functions ¶
func IsNonSaaSDeployment ¶
func IsNonSaaSDeployment() bool
func NewContextWithNameSpace ¶
func NewContextWithNameSpace(ns NamespaceID) context.Context
func NewGlobalContext ¶
func PostgresClient ¶
func PostgresClient(ctx context.Context) (*postgresqlDb.Queries, error)
func RedisClient ¶
Types ¶
type AlreadyPresentError ¶
type AlreadyPresentError struct {
Path string
}
func (AlreadyPresentError) Error ¶
func (e AlreadyPresentError) Error() string
type CypherDriver ¶
type CypherDriver struct {
// contains filtered or unexported fields
}
func (CypherDriver) Close ¶
func (cd CypherDriver) Close() error
func (CypherDriver) NewSession ¶
func (cd CypherDriver) NewSession(config neo4j.SessionConfig) neo4j.Session
func (CypherDriver) Session ¶
func (cd CypherDriver) Session(accessMode neo4j.AccessMode, bookmarks ...string) (neo4j.Session, error)
func (CypherDriver) Target ¶
func (cd CypherDriver) Target() url.URL
func (CypherDriver) VerifyConnectivity ¶
func (cd CypherDriver) VerifyConnectivity() error
type CypherSession ¶
type CypherSession struct {
// contains filtered or unexported fields
}
func (CypherSession) BeginTransaction ¶
func (cs CypherSession) BeginTransaction(configurers ...func(*neo4j.TransactionConfig)) (neo4j.Transaction, error)
func (CypherSession) Close ¶
func (cs CypherSession) Close() error
func (CypherSession) LastBookmark ¶
func (cs CypherSession) LastBookmark() string
func (CypherSession) ReadTransaction ¶
func (cs CypherSession) ReadTransaction(work neo4j.TransactionWork, configurers ...func(*neo4j.TransactionConfig)) (interface{}, error)
func (CypherSession) Run ¶
func (cs CypherSession) Run(cypher string, params map[string]interface{}, configurers ...func(*neo4j.TransactionConfig)) (neo4j.Result, error)
func (CypherSession) WriteTransaction ¶
func (cs CypherSession) WriteTransaction(work neo4j.TransactionWork, configurers ...func(*neo4j.TransactionConfig)) (interface{}, error)
type CypherTransaction ¶
type CypherTransaction struct {
// contains filtered or unexported fields
}
func (CypherTransaction) Close ¶
func (ct CypherTransaction) Close() error
func (CypherTransaction) Commit ¶
func (ct CypherTransaction) Commit() error
func (CypherTransaction) Rollback ¶
func (ct CypherTransaction) Rollback() error
type DBConfigs ¶
type DBConfigs struct { Redis *RedisConfig Neo4j *Neo4jConfig Postgres *PostgresqlConfig Minio *MinioConfig }
type FileDeleteError ¶
type FileDeleteError struct {
Path string
}
func (FileDeleteError) Error ¶
func (e FileDeleteError) Error() string
type FileManager ¶
type FileManager interface { ListFiles(ctx context.Context, pathPrefix string, recursive bool, maxKeys int, skipDir bool) []ObjectInfo UploadLocalFile(ctx context.Context, filename string, localFilename string, overwrite bool, extra interface{}) (UploadResult, error) UploadFile(ctx context.Context, filename string, data []byte, overwrite bool, extra interface{}) (UploadResult, error) DeleteFile(ctx context.Context, filename string, addFilePathPrefix bool, extra interface{}) error DownloadFile(ctx context.Context, remoteFile string, localFile string, extra interface{}) error DownloadFileTo(ctx context.Context, remoteFile string, localFile io.WriteCloser, extra interface{}) error DownloadFileContexts(ctx context.Context, remoteFile string, extra interface{}) ([]byte, error) ExposeFile(ctx context.Context, filePath string, addFilePathPrefix bool, expires time.Duration, reqParams url.Values) (string, error) CreatePublicUploadURL(ctx context.Context, filePath string, addFilePathPrefix bool, expires time.Duration, reqParams url.Values) (string, error) Client() interface{} Bucket() string CreatePublicBucket(ctx context.Context, bucket string) error CleanNamespace(ctx context.Context) error }
func MinioClient ¶
func MinioClient(ctx context.Context) (FileManager, error)
type MinioConfig ¶
type MinioFileManager ¶
type MinioFileManager struct {
// contains filtered or unexported fields
}
func (*MinioFileManager) Bucket ¶
func (mfm *MinioFileManager) Bucket() string
func (*MinioFileManager) CleanNamespace ¶
func (mfm *MinioFileManager) CleanNamespace(ctx context.Context) error
func (*MinioFileManager) Client ¶
func (mfm *MinioFileManager) Client() interface{}
func (*MinioFileManager) CreatePublicBucket ¶
func (mfm *MinioFileManager) CreatePublicBucket(ctx context.Context, bucket string) error
func (*MinioFileManager) CreatePublicUploadURL ¶
func (*MinioFileManager) DeleteFile ¶
func (*MinioFileManager) DownloadFile ¶
func (*MinioFileManager) DownloadFileContexts ¶
func (*MinioFileManager) DownloadFileTo ¶
func (mfm *MinioFileManager) DownloadFileTo(ctx context.Context, remoteFile string, writer io.WriteCloser, extra interface{}) error
func (*MinioFileManager) ExposeFile ¶
func (*MinioFileManager) ListFiles ¶
func (mfm *MinioFileManager) ListFiles(ctx context.Context, pathPrefix string, recursive bool, maxKeys int, skipDir bool) []ObjectInfo
func (*MinioFileManager) UploadFile ¶
func (mfm *MinioFileManager) UploadFile(ctx context.Context, filename string, data []byte, overwrite bool, extra interface{}) (UploadResult, error)
func (*MinioFileManager) UploadLocalFile ¶
func (mfm *MinioFileManager) UploadLocalFile(ctx context.Context, filename string, localFilename string, overwrite bool, extra interface{}) (UploadResult, error)
type NamespaceID ¶
type NamespaceID string
func ExtractNamespace ¶
func ExtractNamespace(ctx context.Context) (NamespaceID, error)
func FetchNamespace ¶
func FetchNamespace(email string) NamespaceID
func GetAllNamespaces ¶
func GetAllNamespaces() []NamespaceID
type Neo4jConfig ¶
type ObjectInfo ¶
type ObjectInfo struct { Key string `json:"name"` // Name of the object LastModified time.Time `json:"lastModified"` // Date and time the object was last modified. Size int64 `json:"size"` // Size in bytes of the object. ContentType string `json:"contentType"` // A standard MIME type describing the format of the object data. Expires time.Time `json:"expires"` // The date and time at which the object is no longer able to be cached. IsDir bool `json:"isDir"` // Is this object a directory }
type PathDoesNotExistsError ¶
type PathDoesNotExistsError struct {
Path string
}
func (PathDoesNotExistsError) Error ¶
func (e PathDoesNotExistsError) Error() string
type PostgresqlConfig ¶
type RedisConfig ¶
type SettingValue ¶
type UploadResult ¶
Click to show internal directories.
Click to hide internal directories.