server

package
v0.12.30 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: LGPL-3.0, LGPL-3.0 Imports: 132 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	IndexCacheTTL    = 5 * time.Minute // 5 minutes for index.html
	NegativeCacheTTL = 2 * time.Minute // 2 minutes for 404s
)

Cache durations

Variables

View Source
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

View Source
var DefaultFileServingConfig = FileServingConfig{
	MaxMemoryReadSize: 100 * 1024,
	CacheMaxAge:       365 * 24 * time.Hour,
	EnableCompression: true,
}

DefaultFileServingConfig provides sensible defaults

View Source
var Stats = stats.New()
View Source
var SubsiteCache olric.DMap

SubsiteCache is a global cache for subsite files using Olric

Functions

func AbortMultipartUpload added in v0.11.4

func AbortMultipartUpload(bucket, key, awsUploadId string) error

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 BeginsWithCheck(str string, beginsWith string) bool

func BuildMiddlewareSet

func BuildMiddlewareSet(cmsConfig *resource.CmsConfig,
	cruds *map[string]*resource.DbResource,
	store ydb.Store,
	dtopicMap *map[string]*olric.PubSub) resource.MiddlewareSet

func CheckErr added in v0.11.4

func CheckErr(err error, message ...interface{}) bool

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 CreateApiBlueprintHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource) func(ctx *gin.Context)

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 CreateJsModelHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource, transaction *sqlx.Tx) func(*gin.Context)

func CreateMetaHandler added in v0.4.0

func CreateMetaHandler(initConfig *resource.CmsConfig) func(*gin.Context)

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 CreateStatsHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource) func(*gin.Context)

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 EndsWith added in v0.2.1

func EndsWith(str string, endsWith string) (string, bool)

func EndsWithCheck added in v0.2.1

func EndsWithCheck(str string, endsWith string) bool

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 GetDbConnection(dbType string, connectionString string) (*sqlx.DB, error)

func GetFileToServe added in v0.11.4

func GetFileToServe(indexByQueryInt int, colDataMapArray []map[string]interface{}, nameByQuery string) (string, string)

func GetLanguagePreference added in v0.9.0

func GetLanguagePreference(header string, defaultLanguage string) []string

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 HandleImageProcessing added in v0.11.4

func HandleImageProcessing(c *gin.Context, file *os.File)

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 InitializeGraphqlResource(initConfig resource.CmsConfig, cruds map[string]*resource.DbResource, defaultRouter *gin.Engine)

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 InitializeYjsResources(store ydb.Store, defaultRouter *gin.Engine,
	cruds map[string]*resource.DbResource, dtopicMap map[string]*olric.PubSub) error

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

func LoadConfigFiles() (resource.CmsConfig, []error)

Load config files which have the naming of the form schema_*_daptin.json/yaml

func MakeGraphqlSchema added in v0.6.9

func MakeGraphqlSchema(cmsConfig *resource.CmsConfig, resources map[string]*resource.DbResource) *graphql.Schema

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 ParseHexColor added in v0.9.0

func ParseHexColor(s string) (c color.RGBA, err error)

func PathExistsAndIsFolder added in v0.11.4

func PathExistsAndIsFolder(path string) bool

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 SmallSnakeCaseText(str string) string

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 CorsInfo

type CorsInfo struct {
	IsCors      bool
	IsPreflight bool
	Origin      string
	OriginUrl   *url.URL

	// The header value is converted to uppercase to avoid common mistakes.
	AccessControlRequestMethod string

	// The header values are normalized with http.CanonicalHeaderKey.
	AccessControlRequestHeaders []string
}

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

type DiskFileCache struct {
	Data         []byte
	ContentType  string
	LastModified time.Time
	ETag         string
}

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

func NewHostStats(cacheValidity time.Duration) *HostStats

NewHostStats creates a new HostStats instance with specified cache validity duration

func (*HostStats) GetCPUInfo added in v0.11.4

func (hs *HostStats) GetCPUInfo() (interface{}, error)

GetCPUInfo returns CPU information with caching

func (*HostStats) GetDiskInfo added in v0.11.4

func (hs *HostStats) GetDiskInfo() (interface{}, error)

GetDiskInfo returns disk information with caching

func (*HostStats) GetHostInfo added in v0.11.4

func (hs *HostStats) GetHostInfo() (interface{}, error)

GetHostInfo returns host information with caching

func (*HostStats) GetLoadInfo added in v0.11.4

func (hs *HostStats) GetLoadInfo() (interface{}, error)

GetLoadInfo returns load average information with caching

func (*HostStats) GetMemInfo added in v0.11.4

func (hs *HostStats) GetMemInfo() (interface{}, error)

GetMemInfo returns memory information with caching

func (*HostStats) GetNetInfo added in v0.11.4

func (hs *HostStats) GetNetInfo() (interface{}, error)

GetNetInfo returns network information with caching

func (*HostStats) GetProcessInfo added in v0.11.4

func (hs *HostStats) GetProcessInfo() (interface{}, error)

GetProcessInfo returns process information with caching

type IndexCacheEntry added in v0.11.4

type IndexCacheEntry struct {
	Content   []byte
	ETag      string
	ModTime   time.Time
	ExpiresAt time.Time
}

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

type NegativeCacheEntry struct {
	ExpiresAt time.Time
}

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
}

func (*SubPathFs) Open added in v0.6.4

func (spf *SubPathFs) Open(name string) (http.File, error)

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

Jump to

Keyboard shortcuts

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