Documentation ¶
Index ¶
- Variables
- func AddResourcesToApi2Go(api *api2go.API, tables []resource.TableInfo, db database.DatabaseConnection, ...) map[string]*resource.DbResource
- func AddStreamsToApi2Go(api *api2go.API, processors []*resource.StreamProcessor, ...)
- func BeginsWithCheck(str string, beginsWith string) bool
- func BuildMiddlewareSet(cmsConfig *resource.CmsConfig, cruds *map[string]*resource.DbResource) resource.MiddlewareSet
- func CheckSystemSecrets(store *resource.ConfigStore) error
- func CleanUpConfigFiles()
- func CreateApiBlueprintHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource) func(ctx *gin.Context)
- func CreateAssetColumnSync(cruds map[string]*resource.DbResource) map[string]map[string]resource.AssetFolderCache
- func CreateConfigHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource, ...) func(*gin.Context)
- func CreateDbAssetHandler(cruds map[string]*resource.DbResource) func(*gin.Context)
- func CreateEventHandler(initConfig *resource.CmsConfig, fsmManager resource.FsmManager, ...) func(context *gin.Context)
- func CreateEventStartHandler(fsmManager resource.FsmManager, cruds map[string]*resource.DbResource, ...) func(context *gin.Context)
- func CreateFeedHandler(cruds map[string]*resource.DbResource, streams []*resource.StreamProcessor) func(*gin.Context)
- func CreateFtpServers(resources map[string]*resource.DbResource, ...) (*server2.FtpServer, error)
- func CreateJsModelHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource) func(*gin.Context)
- func CreateMetaHandler(initConfig *resource.CmsConfig) func(*gin.Context)
- func CreateReclineModelHandler() func(*gin.Context)
- func CreateStatsHandler(initConfig *resource.CmsConfig, cruds map[string]*resource.DbResource) func(*gin.Context)
- func DaptinSmtpAuthenticatorCreator(dbResource *resource.DbResource) func(config backends.BackendConfig) authenticators.Authenticator
- func DaptinSmtpDbResource(dbResource *resource.DbResource, ...) func() backends.Decorator
- func EndsWithCheck(str string, endsWith string) bool
- func Etag(content []byte) (string, error)
- func GetActionPerformers(initConfig *resource.CmsConfig, configStore *resource.ConfigStore, ...) []resource.ActionPerformerInterface
- func GetDbConnection(dbType string, connectionString string) (*sqlx.DB, error)
- func GetFilePath(sourceRoot string, path string) (string, bool)
- func GetLanguagePreference(header string, defaultLanguage string) []string
- func GetStreamProcessors(config *resource.CmsConfig, store *resource.ConfigStore, ...) []*resource.StreamProcessor
- func GetTablesFromWorld(db database.DatabaseConnection) ([]resource.TableInfo, error)
- func InArrayIndex(val interface{}, array interface{}) (index int)
- func LoadConfigFiles() (resource.CmsConfig, []error)
- func MakeGraphqlSchema(cmsConfig *resource.CmsConfig, resources map[string]*resource.DbResource) *graphql.Schema
- func MergeTables(existingTables []resource.TableInfo, initConfigTables []resource.TableInfo) []resource.TableInfo
- func NewSubPathFs(system http.FileSystem, s string) http.FileSystem
- func ParseHexColor(s string) (c color.RGBA, err error)
- func StartSMTPMailServer(resource *resource.DbResource, certificateManager *resource.CertificateManager, ...) (*guerrilla.Daemon, error)
- 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) ([]os.FileInfo, error)
- func (driver *ClientDriver) MakeDirectory(cc server.ClientContext, directory 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 Crammd5
- 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 ErrorResponse
- type HostSwitch
- type JsModel
- type JsonApiError
- type JsonApiRelation
- type LanguageMiddleware
- type SQLProcessor
- type SQLProcessorConfig
- type StaticFsWithDefaultIndex
- type SubPathFs
- type SubSiteAssetCache
- type WebSocketConnectionHandlerImpl
Constants ¶
This section is empty.
Variables ¶
var Schema graphql.Schema
var Stats = stats.New()
var TaskScheduler resource.TaskScheduler
Functions ¶
func AddResourcesToApi2Go ¶
func AddResourcesToApi2Go(api *api2go.API, tables []resource.TableInfo, db database.DatabaseConnection, ms *resource.MiddlewareSet, configStore *resource.ConfigStore, cruds map[string]*resource.DbResource) 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 BeginsWithCheck ¶ added in v0.6.3
func BuildMiddlewareSet ¶
func BuildMiddlewareSet(cmsConfig *resource.CmsConfig, cruds *map[string]*resource.DbResource) resource.MiddlewareSet
func CheckSystemSecrets ¶ added in v0.2.1
func CheckSystemSecrets(store *resource.ConfigStore) error
func CleanUpConfigFiles ¶
func CleanUpConfigFiles()
func CreateApiBlueprintHandler ¶ added in v0.2.1
func CreateAssetColumnSync ¶ added in v0.9.0
func CreateAssetColumnSync(cruds map[string]*resource.DbResource) map[string]map[string]resource.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) func(*gin.Context)
func CreateEventHandler ¶
func CreateEventHandler(initConfig *resource.CmsConfig, fsmManager resource.FsmManager, cruds map[string]*resource.DbResource, db database.DatabaseConnection) func(context *gin.Context)
func CreateEventStartHandler ¶
func CreateEventStartHandler(fsmManager resource.FsmManager, cruds map[string]*resource.DbResource, db database.DatabaseConnection) func(context *gin.Context)
func CreateFeedHandler ¶ added in v0.9.0
func CreateFeedHandler(cruds map[string]*resource.DbResource, streams []*resource.StreamProcessor) func(*gin.Context)
func CreateFtpServers ¶ added in v0.9.0
func CreateFtpServers(resources map[string]*resource.DbResource, certManager *resource.CertificateManager, listener net.Listener) (*server2.FtpServer, error)
func CreateJsModelHandler ¶
func CreateMetaHandler ¶ added in v0.4.0
func CreateReclineModelHandler ¶ added in v0.4.0
func CreateStatsHandler ¶ added in v0.6.2
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 GetActionPerformers ¶
func GetActionPerformers(initConfig *resource.CmsConfig, configStore *resource.ConfigStore, cruds map[string]*resource.DbResource, mailDaemon *guerrilla.Daemon, hostSwitch HostSwitch, certificateManager *resource.CertificateManager) []resource.ActionPerformerInterface
func GetDbConnection ¶ added in v0.2.1
func GetLanguagePreference ¶ added in v0.9.0
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) ([]resource.TableInfo, error)
func InArrayIndex ¶ added in v0.6.8
func InArrayIndex(val interface{}, array interface{}) (index int)
func LoadConfigFiles ¶ added in v0.6.8
Load config files which have the naming of the form schema_*_daptin.json/yaml
func MakeGraphqlSchema ¶ added in v0.6.9
func MergeTables ¶ added in v0.6.4
func NewSubPathFs ¶ added in v0.6.4
func NewSubPathFs(system http.FileSystem, s string) http.FileSystem
func StartSMTPMailServer ¶ added in v0.9.0
func StartSMTPMailServer(resource *resource.DbResource, certificateManager *resource.CertificateManager, primaryHostname string) (*guerrilla.Daemon, error)
Types ¶
type ClientDriver ¶ added in v0.9.0
type ClientDriver struct { BaseDir string // Base directory from which to server file CurrentDir string FtpDriver *DaptinFtpDriver }
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) ([]os.FileInfo, error)
ListFiles lists the files of a directory
func (*ClientDriver) MakeDirectory ¶ added in v0.9.0
func (driver *ClientDriver) MakeDirectory(cc server.ClientContext, directory 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 Crammd5 ¶ added in v0.9.0
type Crammd5 struct {
// contains filtered or unexported fields
}
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, 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 ErrorResponse ¶ added in v0.6.2
type ErrorResponse struct {
Message string
}
type HostSwitch ¶ added in v0.2.1
type HostSwitch struct {
// contains filtered or unexported fields
}
func CreateSubSites ¶ added in v0.2.1
func CreateSubSites(cmsConfig *resource.CmsConfig, db database.DatabaseConnection, cruds map[string]*resource.DbResource, authMiddleware *auth.AuthMiddleware) (HostSwitch, map[string]resource.AssetFolderCache)
func Main ¶
func Main(boxRoot http.FileSystem, db database.DatabaseConnection) (HostSwitch, *guerrilla.Daemon, resource.TaskScheduler, *resource.ConfigStore, *resource.CertificateManager, *server2.FtpServer, *server.Server)
func (HostSwitch) ServeHTTP ¶ added in v0.2.1
func (hs HostSwitch) ServeHTTP(w http.ResponseWriter, r *http.Request)
Implement the ServerHTTP method on our new type
type JsonApiError ¶ added in v0.2.1
type JsonApiError struct {
Message string
}
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) *LanguageMiddleware
func (*LanguageMiddleware) LanguageMiddlewareFunc ¶ added in v0.9.0
func (lm *LanguageMiddleware) LanguageMiddlewareFunc(c *gin.Context)
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 StaticFsWithDefaultIndex ¶ added in v0.6.5
type StaticFsWithDefaultIndex struct {
// contains filtered or unexported fields
}
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 { resource.SubSite resource.AssetFolderCache }
type WebSocketConnectionHandlerImpl ¶ added in v0.6.2
type WebSocketConnectionHandlerImpl struct { }
func (*WebSocketConnectionHandlerImpl) MessageFromClient ¶ added in v0.6.2
func (wsch *WebSocketConnectionHandlerImpl) MessageFromClient(message websockets.WebSocketPayload, request *http.Request)