Documentation
¶
Index ¶
- Constants
- Variables
- func AbortMultipartUpload(bucket, key, awsUploadId string) error
- func AbortS3MultipartUpload(credentials map[string]interface{}, bucket, key, awsUploadId string) error
- func ActionPerformersListToMap(interfaces []actionresponse.ActionPerformerInterface) map[string]actionresponse.ActionPerformerInterface
- func AddResourcesToApi2Go(api *api2go.API, tables []table_info.TableInfo, db database.DatabaseConnection, ...)
- func AddStreamsToApi2Go(api *api2go.API, processors []*resource.StreamProcessor, ...)
- func AssetRouteHandler(cruds map[string]*resource.DbResource) func(c *gin.Context)
- func AssetUploadHandler(cruds map[string]*resource.DbResource) func(c *gin.Context)
- func BeginsWithCheck(str string, beginsWith string) bool
- func BuildMiddlewareSet(cmsConfig *resource.CmsConfig, cruds *map[string]*resource.DbResource, ...) resource.MiddlewareSet
- func CheckErr(err error, message ...interface{}) bool
- func CheckSystemSecrets(store *resource.ConfigStore, transaction *sqlx.Tx) error
- func CleanUpConfigFiles()
- func CompleteMultipartUpload(cruds map[string]*resource.DbResource, bucket, key, awsUploadId string, ...) error
- func CompleteS3MultipartUpload(credentials map[string]interface{}, bucket, key, awsUploadId string, ...) error
- func CreateApiBlueprintHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource) func(ctx *gin.Context)
- func CreateAssetColumnSync(cruds map[string]dbresourceinterface.DbResourceInterface, transaction *sqlx.Tx) map[string]map[string]*assetcachepojo.AssetFolderCache
- func CreateConfigHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource, ...) func(*gin.Context)
- func CreateDbAssetHandler(cruds map[string]*resource.DbResource, olricClient *olric.EmbeddedClient) func(*gin.Context)
- func CreateEventHandler(initConfig *resource.CmsConfig, fsmManager fsm.FsmManager, ...) func(context *gin.Context)
- func CreateEventStartHandler(fsmManager fsm.FsmManager, cruds map[string]*resource.DbResource, ...) func(context *gin.Context)
- func CreateFaviconEndpoint(boxRoot http.FileSystem) gin.HandlerFunc
- func CreateFeedHandler(cruds map[string]*resource.DbResource, streams []*resource.StreamProcessor, ...) func(*gin.Context)
- func CreateFtpServers(resources map[string]*resource.DbResource, ...) (*server.FtpServer, error)
- func CreateIntegrationOpenAPIHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
- func CreateIntegrationOperationDescribeHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
- func CreateIntegrationOperationHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
- func CreateIntegrationOperationsHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
- func CreateJsModelHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource, ...) func(*gin.Context)
- func CreateMetaHandler(initConfig *resource.CmsConfig) func(*gin.Context)
- func CreateRateLimiterMiddleware(rateConfig RateConfig) gin.HandlerFunc
- func CreateStatisticsHandler(db database.DatabaseConnection) func(*gin.Context)
- func CreateStatsHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource) func(*gin.Context)
- func CreateSubSites(cmsConfig *resource.CmsConfig, transaction *sqlx.Tx, ...) (hostswitch.HostSwitch, ...)
- func CreateSubsiteEngine(site subsite.SubSite, assetCache *assetcachepojo.AssetFolderCache, ...) *gin.Engine
- func CreateYjsStore(configStore *resource.ConfigStore, transaction *sqlx.Tx, ...) ydb.Store
- func DaptinSmtpAuthenticatorCreator(dbResource *resource.DbResource) func(config backends.BackendConfig) authenticators.Authenticator
- func DaptinSmtpDbResource(dbResource *resource.DbResource, ...) func() backends.Decorator
- func EndsWith(str string, endsWith string) (string, bool)
- func EndsWithCheck(str string, endsWith string) bool
- func GetCacheMetrics() map[string]interface{}
- func GetDbConnection(dbType string, connectionString string) (*sqlx.DB, error)
- func GetFileToServe(indexByQueryInt int, colDataMapArray []map[string]interface{}, ...) (string, string)
- func GetLanguagePreference(header string, defaultLanguage string) []string
- func GetS3PartPresignedURL(credentials map[string]interface{}, bucketName string, keyPath string, ...) (string, error)
- func GetStreamProcessors(config *resource.CmsConfig, store *resource.ConfigStore, ...) []*resource.StreamProcessor
- func GetTablesFromWorld(db database.DatabaseConnection) ([]table_info.TableInfo, error)
- func HandleImageProcessing(c *gin.Context, file *os.File)
- func InitSubsiteCache(client *olric.EmbeddedClient) error
- func InitialiseServerResources(initConfig *resource.CmsConfig, db database.DatabaseConnection)
- func InitializeCaldavResources(authMiddleware *auth.AuthMiddleware, cruds map[string]*resource.DbResource, ...)
- func InitializeFtpResources(configStore *resource.ConfigStore, transaction *sqlx.Tx, ...) *server.FtpServer
- func InitializeGraphqlResource(initConfig resource.CmsConfig, cruds map[string]*resource.DbResource, ...)
- func InitializeImapResources(configStore *resource.ConfigStore, transaction *sqlx.Tx, ...) *server.Server
- func InitializeOAuthResources(cruds map[string]*resource.DbResource, configStore *resource.ConfigStore, ...)
- func InitializeYjsResources(store ydb.Store, defaultRouter *gin.Engine, ...) error
- func InitiateS3MultipartUpload(credentials map[string]interface{}, bucketName string, keyPath string) (string, error)
- func LoadConfigFiles() (resource.CmsConfig, []error)
- func Main(boxRoot http.FileSystem, db database.DatabaseConnection, ...) (hostswitch.HostSwitch, *guerrilla.Daemon, task_scheduler.TaskScheduler, ...)
- func MakeGraphqlSchema(cmsConfig *resource.CmsConfig, resources map[string]*resource.DbResource) *graphql.Schema
- func MergeTables(existingTables []table_info.TableInfo, initConfigTables []table_info.TableInfo) []table_info.TableInfo
- func NewSubPathFs(system http.FileSystem, s string) http.FileSystem
- func ParseHexColor(s string) (c color.RGBA, err error)
- func PathExistsAndIsFolder(path string) bool
- func PrintCliBanner()
- func ProcessEventMessage(eventMessage resource.WsOutMessage, msg *redis.Message, typename string, ...) error
- func RegisterLLMEndpoints(router *gin.Engine, goaiProvider *llm.GoAIProvider, ...)
- func ServeFileOptimally(c *gin.Context, fullPath string, fileInfo os.FileInfo, ...) error
- func SetClientCacheHeaders(c *gin.Context, cachedFile *DiskFileCache)
- func SetupNoRouteRouter(boxRoot http.FileSystem, defaultRouter *gin.Engine)
- func ShutdownFileCache()
- func SmallSnakeCaseText(str string) string
- func StartSMTPMailServer(mailResource *resource.DbResource, ...) (*guerrilla.Daemon, error)
- func SubsiteRequestHandler(site subsite.SubSite, assetCache *assetcachepojo.AssetFolderCache) func(c *gin.Context)
- func TrackCacheBypassed()
- type ClientDriver
- func (driver *ClientDriver) CanAllocate(cc server.ClientContext, size int) (bool, error)
- func (driver *ClientDriver) ChangeDirectory(cc server.ClientContext, directory string) error
- func (driver *ClientDriver) ChmodFile(cc server.ClientContext, path string, mode os.FileMode) error
- func (driver *ClientDriver) DeleteFile(cc server.ClientContext, path string) error
- func (driver *ClientDriver) GetFileInfo(cc server.ClientContext, path string) (os.FileInfo, error)
- func (driver *ClientDriver) ListFiles(cc server.ClientContext, directory string) ([]fs.FileInfo, error)
- func (driver *ClientDriver) MakeDirectory(cc server.ClientContext, path string) error
- func (driver *ClientDriver) OpenFile(cc server.ClientContext, path string, flag int) (server.FileStream, error)
- func (driver *ClientDriver) RenameFile(cc server.ClientContext, from, to string) error
- func (driver *ClientDriver) SetFileMtime(cc server.ClientContext, path string, mtime time.Time) error
- type Compressor
- type CorsInfo
- type CorsMiddleware
- type DaptinFtpDriver
- func (driver *DaptinFtpDriver) AuthUser(cc server.ClientContext, user, pass string) (server.ClientHandlingDriver, error)
- func (driver *DaptinFtpDriver) GetSettings() (*server.Settings, error)
- func (driver *DaptinFtpDriver) GetTLSConfig() (*tls.Config, error)
- func (driver *DaptinFtpDriver) UserLeft(cc server.ClientContext)
- func (driver *DaptinFtpDriver) WelcomeUser(cc server.ClientContext) (string, error)
- type DaptinFtpServerSettings
- type DaptinSmtpAuthenticator
- func (dsa *DaptinSmtpAuthenticator) DecodeLogin(login string) (string, error)
- func (dsa *DaptinSmtpAuthenticator) ExtractLoginFromAuthString(authString string) string
- func (dsa *DaptinSmtpAuthenticator) GenerateCRAMMD5Challenge() (string, error)
- func (dsa *DaptinSmtpAuthenticator) GetAdvertiseAuthentication(authType []string) string
- func (dsa *DaptinSmtpAuthenticator) GetMailSize(login string, defaultSize int64) int64
- func (dsa *DaptinSmtpAuthenticator) VerifyCRAMMD5(challenge, authString string) bool
- func (dsa *DaptinSmtpAuthenticator) VerifyLOGIN(login, passwordBase64 string) bool
- type DiskFileCache
- type ErrorResponse
- type FileServingConfig
- type HostStats
- func (hs *HostStats) GetCPUInfo() (interface{}, error)
- func (hs *HostStats) GetDiskInfo() (interface{}, error)
- func (hs *HostStats) GetHostInfo() (interface{}, error)
- func (hs *HostStats) GetLoadInfo() (interface{}, error)
- func (hs *HostStats) GetMemInfo() (interface{}, error)
- func (hs *HostStats) GetNetInfo() (interface{}, error)
- func (hs *HostStats) GetProcessInfo() (interface{}, error)
- type IndexCacheEntry
- type JsModel
- type JsonApiRelation
- type LanguageMiddleware
- type NegativeCacheEntry
- type RateConfig
- type SQLProcessor
- type SQLProcessorConfig
- type StatCache
- type SubPathFs
- type SubSiteAssetCache
- type SubsiteCacheEntry
- type YjsConnectionSessionFetcher
Constants ¶
const ( IndexCacheTTL = 5 * time.Minute // 5 minutes for index.html NegativeCacheTTL = 2 * time.Minute // 2 minutes for 404s )
Cache durations
Variables ¶
var CacheConfig = struct { DefaultTTL time.Duration // Default time-to-live for cache entries MaxEntrySize int64 // Maximum size of a single cache entry (100KB) EnableCache bool // Toggle to enable/disable caching Namespace string // Olric cache namespace }{ DefaultTTL: time.Minute * 30, MaxEntrySize: 100 * 1024, EnableCache: true, Namespace: "subsite-cache", }
CacheConfig holds configuration for the cache
var DefaultFileServingConfig = FileServingConfig{ MaxMemoryReadSize: 100 * 1024, CacheMaxAge: 365 * 24 * time.Hour, EnableCompression: true, }
DefaultFileServingConfig provides sensible defaults
var Schema graphql.Schema
var Stats = stats.New()
var SubsiteCache olric.DMap
SubsiteCache is a global cache for subsite files using Olric
var TaskScheduler task_scheduler.TaskScheduler
Functions ¶
func AbortMultipartUpload ¶ added in v0.11.4
AbortMultipartUpload aborts a multipart upload on S3
func AbortS3MultipartUpload ¶ added in v0.11.4
func AbortS3MultipartUpload(credentials map[string]interface{}, bucket, key, awsUploadId string) error
AbortS3MultipartUpload aborts a multipart upload on S3 with provided credentials
func ActionPerformersListToMap ¶ added in v0.11.4
func ActionPerformersListToMap(interfaces []actionresponse.ActionPerformerInterface) map[string]actionresponse.ActionPerformerInterface
func AddResourcesToApi2Go ¶
func AddResourcesToApi2Go(api *api2go.API, tables []table_info.TableInfo, db database.DatabaseConnection, ms *resource.MiddlewareSet, configStore *resource.ConfigStore, olricDb *olric.EmbeddedClient, cruds map[string]*resource.DbResource)
func AddStreamsToApi2Go ¶ added in v0.4.0
func AddStreamsToApi2Go(api *api2go.API, processors []*resource.StreamProcessor, db database.DatabaseConnection, middlewareSet *resource.MiddlewareSet, configStore *resource.ConfigStore)
func AssetRouteHandler ¶ added in v0.11.4
func AssetRouteHandler(cruds map[string]*resource.DbResource) func(c *gin.Context)
func AssetUploadHandler ¶ added in v0.11.4
func AssetUploadHandler(cruds map[string]*resource.DbResource) func(c *gin.Context)
AssetUploadHandler handles direct asset uploads with streaming support
func BeginsWithCheck ¶ added in v0.6.3
func BuildMiddlewareSet ¶
func CheckSystemSecrets ¶ added in v0.2.1
func CheckSystemSecrets(store *resource.ConfigStore, transaction *sqlx.Tx) error
func CleanUpConfigFiles ¶
func CleanUpConfigFiles()
func CompleteMultipartUpload ¶ added in v0.11.4
func CompleteMultipartUpload(cruds map[string]*resource.DbResource, bucket, key, awsUploadId string, parts []map[string]interface{}) error
CompleteMultipartUpload completes a multipart upload on S3
func CompleteS3MultipartUpload ¶ added in v0.11.4
func CompleteS3MultipartUpload(credentials map[string]interface{}, bucket, key, awsUploadId string, parts []map[string]interface{}) error
CompleteS3MultipartUpload completes a multipart upload on S3 with provided credentials
func CreateApiBlueprintHandler ¶ added in v0.2.1
func CreateAssetColumnSync ¶ added in v0.9.0
func CreateAssetColumnSync(cruds map[string]dbresourceinterface.DbResourceInterface, transaction *sqlx.Tx) map[string]map[string]*assetcachepojo.AssetFolderCache
func CreateConfigHandler ¶
func CreateConfigHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource, configStore *resource.ConfigStore) func(*gin.Context)
func CreateDbAssetHandler ¶ added in v0.9.0
func CreateDbAssetHandler(cruds map[string]*resource.DbResource, olricClient *olric.EmbeddedClient) func(*gin.Context)
CreateDbAssetHandler optimized for static file serving with aggressive caching
func CreateEventHandler ¶
func CreateEventHandler(initConfig *resource.CmsConfig, fsmManager fsm.FsmManager, cruds map[string]*resource.DbResource, db database.DatabaseConnection) func(context *gin.Context)
func CreateEventStartHandler ¶
func CreateEventStartHandler(fsmManager fsm.FsmManager, cruds map[string]*resource.DbResource, db database.DatabaseConnection) func(context *gin.Context)
func CreateFaviconEndpoint ¶ added in v0.11.4
func CreateFaviconEndpoint(boxRoot http.FileSystem) gin.HandlerFunc
func CreateFeedHandler ¶ added in v0.9.0
func CreateFeedHandler(cruds map[string]*resource.DbResource, streams []*resource.StreamProcessor, transaction *sqlx.Tx) func(*gin.Context)
func CreateFtpServers ¶ added in v0.9.0
func CreateFtpServers(resources map[string]*resource.DbResource, resourcesInterfaces map[string]dbresourceinterface.DbResourceInterface, certManager *resource.CertificateManager, ftp_interface string, transaction *sqlx.Tx) (*server.FtpServer, error)
func CreateIntegrationOpenAPIHandler ¶ added in v0.12.5
func CreateIntegrationOpenAPIHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
func CreateIntegrationOperationDescribeHandler ¶ added in v0.12.5
func CreateIntegrationOperationDescribeHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
func CreateIntegrationOperationHandler ¶ added in v0.12.4
func CreateIntegrationOperationHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
func CreateIntegrationOperationsHandler ¶ added in v0.12.5
func CreateIntegrationOperationsHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
func CreateJsModelHandler ¶
func CreateMetaHandler ¶ added in v0.4.0
func CreateRateLimiterMiddleware ¶ added in v0.11.4
func CreateRateLimiterMiddleware(rateConfig RateConfig) gin.HandlerFunc
func CreateStatisticsHandler ¶ added in v0.11.4
func CreateStatisticsHandler(db database.DatabaseConnection) func(*gin.Context)
func CreateStatsHandler ¶ added in v0.6.2
func CreateSubSites ¶ added in v0.2.1
func CreateSubSites(cmsConfig *resource.CmsConfig, transaction *sqlx.Tx, cruds map[string]*resource.DbResource, authMiddleware *auth.AuthMiddleware, rateConfig RateConfig, max_connections int, olricClient *olric.EmbeddedClient) (hostswitch.HostSwitch, map[daptinid.DaptinReferenceId]*assetcachepojo.AssetFolderCache)
func CreateSubsiteEngine ¶ added in v0.11.4
func CreateSubsiteEngine(site subsite.SubSite, assetCache *assetcachepojo.AssetFolderCache, middlewares []gin.HandlerFunc) *gin.Engine
func CreateYjsStore ¶ added in v0.11.4
func CreateYjsStore(configStore *resource.ConfigStore, transaction *sqlx.Tx, localStoragePath string, cruds map[string]*resource.DbResource) ydb.Store
func DaptinSmtpAuthenticatorCreator ¶ added in v0.9.0
func DaptinSmtpAuthenticatorCreator(dbResource *resource.DbResource) func(config backends.BackendConfig) authenticators.Authenticator
func DaptinSmtpDbResource ¶ added in v0.9.0
func DaptinSmtpDbResource(dbResource *resource.DbResource, certificateManager *resource.CertificateManager) func() backends.Decorator
func EndsWithCheck ¶ added in v0.2.1
func GetCacheMetrics ¶ added in v0.11.4
func GetCacheMetrics() map[string]interface{}
GetCacheMetrics returns current cache metrics for monitoring
func GetDbConnection ¶ added in v0.2.1
func GetFileToServe ¶ added in v0.11.4
func GetLanguagePreference ¶ added in v0.9.0
func GetS3PartPresignedURL ¶ added in v0.11.4
func GetS3PartPresignedURL(credentials map[string]interface{}, bucketName string, keyPath string, uploadId string, partNumber int32) (string, error)
GetS3PartPresignedURL generates a presigned URL for a specific part in a multipart upload
func GetStreamProcessors ¶ added in v0.4.0
func GetStreamProcessors(config *resource.CmsConfig, store *resource.ConfigStore, cruds map[string]*resource.DbResource) []*resource.StreamProcessor
func GetTablesFromWorld ¶
func GetTablesFromWorld(db database.DatabaseConnection) ([]table_info.TableInfo, error)
func HandleImageProcessing ¶ added in v0.11.4
func InitSubsiteCache ¶ added in v0.11.4
func InitSubsiteCache(client *olric.EmbeddedClient) error
InitSubsiteCache initializes the Olric cache for subsites
func InitialiseServerResources ¶ added in v0.11.4
func InitialiseServerResources(initConfig *resource.CmsConfig, db database.DatabaseConnection)
func InitializeCaldavResources ¶ added in v0.11.4
func InitializeCaldavResources( authMiddleware *auth.AuthMiddleware, cruds map[string]*resource.DbResource, certManager *resource.CertificateManager, defaultRouter *gin.Engine)
InitializeCaldavResources sets up CalDAV/CardDAV endpoints Pattern: like InitializeImapResources - receives cruds parameter
func InitializeFtpResources ¶ added in v0.11.4
func InitializeFtpResources(configStore *resource.ConfigStore, transaction *sqlx.Tx, ftpServer *server.FtpServer, cruds map[string]*resource.DbResource, crudsInterface map[string]dbresourceinterface.DbResourceInterface, certificateManager *resource.CertificateManager) *server.FtpServer
func InitializeGraphqlResource ¶ added in v0.11.4
func InitializeImapResources ¶ added in v0.11.4
func InitializeImapResources(configStore *resource.ConfigStore, transaction *sqlx.Tx, cruds map[string]*resource.DbResource, imapServer *server.Server, certificateManager *resource.CertificateManager) *server.Server
func InitializeOAuthResources ¶ added in v0.11.6
func InitializeOAuthResources(cruds map[string]*resource.DbResource, configStore *resource.ConfigStore, defaultRouter *gin.Engine)
func InitializeYjsResources ¶ added in v0.11.4
func InitiateS3MultipartUpload ¶ added in v0.11.4
func InitiateS3MultipartUpload(credentials map[string]interface{}, bucketName string, keyPath string) (string, error)
InitiateS3MultipartUpload starts a new multipart upload session on S3
func LoadConfigFiles ¶ added in v0.6.8
Load config files which have the naming of the form schema_*_daptin.json/yaml
func Main ¶
func Main(boxRoot http.FileSystem, db database.DatabaseConnection, localStoragePath string, olricDb *olric.EmbeddedClient, localOlricAddr string) ( hostswitch.HostSwitch, *guerrilla.Daemon, task_scheduler.TaskScheduler, *resource.ConfigStore, *resource.CertificateManager, *server2.FtpServer, *server.Server, *olric.EmbeddedClient)
func MakeGraphqlSchema ¶ added in v0.6.9
func MergeTables ¶ added in v0.6.4
func MergeTables(existingTables []table_info.TableInfo, initConfigTables []table_info.TableInfo) []table_info.TableInfo
func NewSubPathFs ¶ added in v0.6.4
func NewSubPathFs(system http.FileSystem, s string) http.FileSystem
func PathExistsAndIsFolder ¶ added in v0.11.4
PathExistsAndIsFolder checks if a path exists and is a folder
func PrintCliBanner ¶ added in v0.11.4
func PrintCliBanner()
func ProcessEventMessage ¶ added in v0.11.4
func ProcessEventMessage(eventMessage resource.WsOutMessage, msg *redis.Message, typename string, cruds map[string]*resource.DbResource, columnInfo api2go.ColumnInfo, store ydb.Store) error
func RegisterLLMEndpoints ¶ added in v0.11.7
func RegisterLLMEndpoints(router *gin.Engine, goaiProvider *llm.GoAIProvider, cruds map[string]*resource.DbResource)
RegisterLLMEndpoints registers OpenAI-compatible API endpoints on the router. These endpoints provide a drop-in replacement for OpenAI's API so any tool/SDK can point at Daptin instead.
func ServeFileOptimally ¶ added in v0.11.4
func ServeFileOptimally(c *gin.Context, fullPath string, fileInfo os.FileInfo, config FileServingConfig) error
ServeFileOptimally serves a file using the most appropriate strategy
func SetClientCacheHeaders ¶ added in v0.11.4
func SetClientCacheHeaders(c *gin.Context, cachedFile *DiskFileCache)
Set HTTP cache headers based on the cached file
func SetupNoRouteRouter ¶ added in v0.11.4
func SetupNoRouteRouter(boxRoot http.FileSystem, defaultRouter *gin.Engine)
func ShutdownFileCache ¶ added in v0.11.4
func ShutdownFileCache()
ShutdownFileCache properly shuts down the global file cache This should be called during application shutdown
func SmallSnakeCaseText ¶ added in v0.11.4
func StartSMTPMailServer ¶ added in v0.9.0
func StartSMTPMailServer(mailResource *resource.DbResource, certificateManager *resource.CertificateManager, primaryHostname string, transaction *sqlx.Tx) (*guerrilla.Daemon, error)
func SubsiteRequestHandler ¶ added in v0.11.4
func SubsiteRequestHandler(site subsite.SubSite, assetCache *assetcachepojo.AssetFolderCache) func(c *gin.Context)
func TrackCacheBypassed ¶ added in v0.11.4
func TrackCacheBypassed()
TrackCacheBypassed increments the cache bypassed counter for large files
Types ¶
type ClientDriver ¶ added in v0.9.0
type ClientDriver struct {
BaseDir string // Base directory from which to server file
CurrentDir string
FtpDriver *DaptinFtpDriver
// contains filtered or unexported fields
}
ClientDriver defines a very basic client driver
func (*ClientDriver) CanAllocate ¶ added in v0.9.0
func (driver *ClientDriver) CanAllocate(cc server.ClientContext, size int) (bool, error)
CanAllocate gives the approval to allocate some data
func (*ClientDriver) ChangeDirectory ¶ added in v0.9.0
func (driver *ClientDriver) ChangeDirectory(cc server.ClientContext, directory string) error
ChangeDirectory changes the current working directory
func (*ClientDriver) ChmodFile ¶ added in v0.9.0
func (driver *ClientDriver) ChmodFile(cc server.ClientContext, path string, mode os.FileMode) error
ChmodFile changes the attributes of the file
func (*ClientDriver) DeleteFile ¶ added in v0.9.0
func (driver *ClientDriver) DeleteFile(cc server.ClientContext, path string) error
DeleteFile deletes a file or a directory
func (*ClientDriver) GetFileInfo ¶ added in v0.9.0
func (driver *ClientDriver) GetFileInfo(cc server.ClientContext, path string) (os.FileInfo, error)
GetFileInfo gets some info around a file or a directory
func (*ClientDriver) ListFiles ¶ added in v0.9.0
func (driver *ClientDriver) ListFiles(cc server.ClientContext, directory string) ([]fs.FileInfo, error)
ListFiles lists the files of a directory
func (*ClientDriver) MakeDirectory ¶ added in v0.9.0
func (driver *ClientDriver) MakeDirectory(cc server.ClientContext, path string) error
MakeDirectory creates a directory
func (*ClientDriver) OpenFile ¶ added in v0.9.0
func (driver *ClientDriver) OpenFile(cc server.ClientContext, path string, flag int) (server.FileStream, error)
OpenFile opens a file in 3 possible modes: read, write, appending write (use appropriate flags)
func (*ClientDriver) RenameFile ¶ added in v0.9.0
func (driver *ClientDriver) RenameFile(cc server.ClientContext, from, to string) error
RenameFile renames a file or a directory
func (*ClientDriver) SetFileMtime ¶ added in v0.9.0
func (driver *ClientDriver) SetFileMtime(cc server.ClientContext, path string, mtime time.Time) error
type Compressor ¶ added in v0.9.0
type Compressor interface {
String() string
}
compressedData struct will be compressed using zlib when printed via fmt
type CorsMiddleware ¶
type CorsMiddleware struct {
// Reject non CORS requests if true. See CorsInfo.IsCors.
RejectNonCorsRequests bool
// Function executed for every CORS requests to validate the Origin. (Required)
// Must return true if valid, false if invalid.
// For instance: simple equality, regexp, DB lookup, ...
OriginValidator func(origin string, request *http.Request) bool
// List of allowed HTTP methods. Note that the comparison will be made in
// uppercase to avoid common mistakes. And that the
// Access-Control-Allow-Methods response header also uses uppercase.
// (see CorsInfo.AccessControlRequestMethod)
AllowedMethods []string
// List of allowed HTTP Headers. Note that the comparison will be made with
// noarmalized names (http.CanonicalHeaderKey). And that the response header
// also uses normalized names.
// (see CorsInfo.AccessControlRequestHeaders)
AllowedHeaders []string
// List of headers used to set the Access-Control-Expose-Headers header.
AccessControlExposeHeaders []string
// User to se the Access-Control-Allow-Credentials response header.
AccessControlAllowCredentials bool
// Used to set the Access-Control-Max-Age response header, in seconds.
AccessControlMaxAge int
// contains filtered or unexported fields
}
CorsMiddleware provides a configurable CORS implementation.
func NewCorsMiddleware ¶ added in v0.9.0
func NewCorsMiddleware() *CorsMiddleware
func (*CorsMiddleware) CorsMiddlewareFunc ¶ added in v0.9.0
func (cm *CorsMiddleware) CorsMiddlewareFunc(c *gin.Context)
type DaptinFtpDriver ¶ added in v0.9.0
type DaptinFtpDriver struct {
Logger *log.Logger // Logger
BaseDir string // Base directory from which to serve file
DaptinFtpServerSettings DaptinFtpServerSettings // Our settings
Sites map[string]SubSiteAssetCache
CertManager *resource.CertificateManager
// contains filtered or unexported fields
}
DaptinFtpDriver defines a very basic ftpserver driver
func NewDaptinFtpDriver ¶ added in v0.9.0
func NewDaptinFtpDriver(cruds map[string]*resource.DbResource, certManager *resource.CertificateManager, ftp_interface string, sites []SubSiteAssetCache) (*DaptinFtpDriver, error)
NewDaptinFtpDriver creates a new driver
func (*DaptinFtpDriver) AuthUser ¶ added in v0.9.0
func (driver *DaptinFtpDriver) AuthUser(cc server.ClientContext, user, pass string) (server.ClientHandlingDriver, error)
AuthUser authenticates the user and selects an handling driver
func (*DaptinFtpDriver) GetSettings ¶ added in v0.9.0
func (driver *DaptinFtpDriver) GetSettings() (*server.Settings, error)
GetSettings returns some general settings around the server setup
func (*DaptinFtpDriver) GetTLSConfig ¶ added in v0.9.0
func (driver *DaptinFtpDriver) GetTLSConfig() (*tls.Config, error)
GetTLSConfig returns a TLS Certificate to use
func (*DaptinFtpDriver) UserLeft ¶ added in v0.9.0
func (driver *DaptinFtpDriver) UserLeft(cc server.ClientContext)
UserLeft is called when the user disconnects, even if he never authenticated
func (*DaptinFtpDriver) WelcomeUser ¶ added in v0.9.0
func (driver *DaptinFtpDriver) WelcomeUser(cc server.ClientContext) (string, error)
WelcomeUser is called to send the very first welcome message
type DaptinFtpServerSettings ¶ added in v0.9.0
type DaptinFtpServerSettings struct {
Server server.Settings // Server settings (shouldn't need to be filled)
MaxConnections int32 // Maximum number of clients that are allowed to connect at the same time
}
DaptinFtpServerSettings defines our settings
type DaptinSmtpAuthenticator ¶ added in v0.9.0
type DaptinSmtpAuthenticator struct {
// contains filtered or unexported fields
}
func (*DaptinSmtpAuthenticator) DecodeLogin ¶ added in v0.9.0
func (dsa *DaptinSmtpAuthenticator) DecodeLogin(login string) (string, error)
func (*DaptinSmtpAuthenticator) ExtractLoginFromAuthString ¶ added in v0.9.0
func (dsa *DaptinSmtpAuthenticator) ExtractLoginFromAuthString(authString string) string
func (*DaptinSmtpAuthenticator) GenerateCRAMMD5Challenge ¶ added in v0.9.0
func (dsa *DaptinSmtpAuthenticator) GenerateCRAMMD5Challenge() (string, error)
func (*DaptinSmtpAuthenticator) GetAdvertiseAuthentication ¶ added in v0.9.0
func (dsa *DaptinSmtpAuthenticator) GetAdvertiseAuthentication(authType []string) string
func (*DaptinSmtpAuthenticator) GetMailSize ¶ added in v0.9.0
func (dsa *DaptinSmtpAuthenticator) GetMailSize(login string, defaultSize int64) int64
func (*DaptinSmtpAuthenticator) VerifyCRAMMD5 ¶ added in v0.9.0
func (dsa *DaptinSmtpAuthenticator) VerifyCRAMMD5(challenge, authString string) bool
func (*DaptinSmtpAuthenticator) VerifyLOGIN ¶ added in v0.9.0
func (dsa *DaptinSmtpAuthenticator) VerifyLOGIN(login, passwordBase64 string) bool
type DiskFileCache ¶ added in v0.11.4
DiskFileCache represents a cached file entry
type ErrorResponse ¶ added in v0.6.2
type ErrorResponse struct {
Message string
}
type FileServingConfig ¶ added in v0.11.4
type FileServingConfig struct {
MaxMemoryReadSize int64 // Maximum file size to read into memory
CacheMaxAge time.Duration // Cache duration for static assets
EnableCompression bool // Whether to enable compression
}
FileServingConfig holds configuration for consistent file serving
type HostStats ¶ added in v0.11.4
type HostStats struct {
// contains filtered or unexported fields
}
HostStats holds all host statistics with caching
func NewHostStats ¶ added in v0.11.4
NewHostStats creates a new HostStats instance with specified cache validity duration
func (*HostStats) GetCPUInfo ¶ added in v0.11.4
GetCPUInfo returns CPU information with caching
func (*HostStats) GetDiskInfo ¶ added in v0.11.4
GetDiskInfo returns disk information with caching
func (*HostStats) GetHostInfo ¶ added in v0.11.4
GetHostInfo returns host information with caching
func (*HostStats) GetLoadInfo ¶ added in v0.11.4
GetLoadInfo returns load average information with caching
func (*HostStats) GetMemInfo ¶ added in v0.11.4
GetMemInfo returns memory information with caching
func (*HostStats) GetNetInfo ¶ added in v0.11.4
GetNetInfo returns network information with caching
func (*HostStats) GetProcessInfo ¶ added in v0.11.4
GetProcessInfo returns process information with caching
type IndexCacheEntry ¶ added in v0.11.4
IndexCacheEntry holds cached index.html content with TTL
type JsModel ¶
type JsModel struct {
ColumnModel map[string]interface{}
Actions []actionresponse.Action
StateMachines []map[string]interface{}
IsStateMachineEnabled bool
}
type JsonApiRelation ¶
type JsonApiRelation struct {
JsonApi string `json:"jsonApi,omitempty"`
ColumnType string `json:"columnType"`
Type string `json:"type,omitempty"`
ColumnName string `json:"ColumnName"`
}
func NewJsonApiRelation ¶
func NewJsonApiRelation(name string, relationName string, relationType string, columnType string) JsonApiRelation
type LanguageMiddleware ¶ added in v0.9.0
type LanguageMiddleware struct {
// contains filtered or unexported fields
}
CorsMiddleware provides a configurable CORS implementation.
func NewLanguageMiddleware ¶ added in v0.9.0
func NewLanguageMiddleware(configStore *resource.ConfigStore, transaction *sqlx.Tx) *LanguageMiddleware
func (*LanguageMiddleware) LanguageMiddlewareFunc ¶ added in v0.9.0
func (lm *LanguageMiddleware) LanguageMiddlewareFunc(c *gin.Context)
type NegativeCacheEntry ¶ added in v0.11.4
NegativeCacheEntry holds 404 cache information
type RateConfig ¶ added in v0.9.9
type RateConfig struct {
// contains filtered or unexported fields
}
type SQLProcessor ¶ added in v0.9.0
type SQLProcessor struct {
// contains filtered or unexported fields
}
type SQLProcessorConfig ¶ added in v0.9.0
type SQLProcessorConfig struct {
PrimaryHost string `json:"primary_mail_host"`
DbResource *resource.DbResource
}
type StatCache ¶ added in v0.11.4
type StatCache struct {
// contains filtered or unexported fields
}
StatCache holds cached statistics data with timestamps
type SubPathFs ¶ added in v0.6.4
type SubPathFs struct {
// contains filtered or unexported fields
}
type SubSiteAssetCache ¶ added in v0.9.0
type SubSiteAssetCache struct {
subsite.SubSite
*assetcachepojo.AssetFolderCache
}
type SubsiteCacheEntry ¶ added in v0.11.4
type SubsiteCacheEntry struct {
ETag string
Content []byte // Stores either compressed or uncompressed content
IsCompressed bool // Indicates if Content is compressed
ContentType string
LastModified time.Time
FilePath string // Store the actual file path for checking modifications
ExpiresAt time.Time // When this cache entry expires
Size int64 // Size of the content for memory tracking
}
SubsiteCacheEntry represents a cached file with its etag, content, and expiration
func (*SubsiteCacheEntry) MarshalBinary ¶ added in v0.11.4
func (sce *SubsiteCacheEntry) MarshalBinary() ([]byte, error)
MarshalBinary implements encoding.BinaryMarshaler interface for Olric compatibility
func (*SubsiteCacheEntry) UnmarshalBinary ¶ added in v0.11.4
func (sce *SubsiteCacheEntry) UnmarshalBinary(data []byte) error
UnmarshalBinary implements encoding.BinaryUnmarshaler interface for Olric compatibility
type YjsConnectionSessionFetcher ¶ added in v0.11.4
type YjsConnectionSessionFetcher struct {
}
func (*YjsConnectionSessionFetcher) GetSessionId ¶ added in v0.11.4
func (y *YjsConnectionSessionFetcher) GetSessionId(r *http.Request, roomname string) uint64
Source Files
¶
- asset_column_sync.go
- asset_presigned_url.go
- asset_route_handler.go
- asset_upload_handler.go
- assets_column_handler.go
- banner.go
- config.go
- config_handler.go
- cors.go
- database_connection.go
- endpoint_caldav.go
- endpoint_favicon.go
- endpoint_ftp.go
- endpoint_ftp_init.go
- endpoint_graphql.go
- endpoint_imap.go
- endpoint_init.go
- endpoint_llm.go
- endpoint_no_route.go
- endpoint_oauth.go
- endpoint_oauth_browser.go
- endpoint_yjs.go
- event_message_handler.go
- feed_handler.go
- file_serving_utils.go
- ftp_server.go
- graphql.go
- handlers.go
- image.go
- integration_operation_discovery_handler.go
- integration_operation_graphql.go
- integration_operation_handler.go
- jsmodel_handler.go
- language.go
- mail_adapter.go
- merge_tables.go
- middleware_ratelimit.go
- server.go
- smtp_server.go
- statistics.go
- sub_path_fs.go
- subsite_cache.go
- subsite_engine.go
- subsite_handler.go
- subsites.go
- utils.go
- yjs_doucment_provider.go