Documentation
¶
Index ¶
- Constants
- Variables
- type AnswerStatusInfo
- type Archive
- type Config
- type ConfigApp
- type ConfigDiscovery
- type ConfigDiscoveryDNS
- type ConfigDiscoveryPlaintext
- type ConfigMetadata
- type ConfigMetadataSQLDB
- type ConfigStorage
- type ConfigStorageFilesystem
- type ConfigStorageFilesystemBase
- type ConfigStorageFilesystemModel
- type ConfigStorageFilesystemModule
- type ErrorBody
- type ErrorDetails
- type LabelChanged
- type ModelData
- type ModelID
- type ModuleData
- type ModuleID
- type QueryParameters
- type ReloadResponse
- type Response
- type ResponseModel
- type ResponseModule
- type ResponseStatus
- type ServableID
- type ServableInstances
Constants ¶
const ( StableLabel = "stable" PrevStableLabel = "last_stable" StatusRunning = "running" StatusReady = "ready" StatusPending = "pending" RequestFieldStatus = "status" // MaxTeamLength model team max length MaxTeamLength = 32 // MaxProjectLength model project max length MaxProjectLength = 32 // MaxModelNameLength model name max length MaxModelNameLength = 32 ComponentServing = "SERVING" ComponentStorage = "STORAGE" ComponentLock = "LOCK" ComponentDiscovery = "DISCOVERY" ComponentMetadata = "METADATA" ComponentService = "SERVICE" ComponentRest = "REST" ComponentAPP = "APP" )
Variables ¶
var (
ErrCLIUsage error = errors.New("cli usage")
)
Functions ¶
This section is empty.
Types ¶
type AnswerStatusInfo ¶
type AnswerStatusInfo struct {
ResponseStatus
ErrorToLog string
Endpoint string
}
type Config ¶
type Config struct {
App ConfigApp `yaml:"application"`
Discovery ConfigDiscovery `yaml:"discovery" group:"Discovery Options"`
Storage ConfigStorage `yaml:"storage" group:"Storage Options"`
Metadata ConfigMetadata `yaml:"metadata" group:"Metadata Options"`
}
Config holds all configuration parameters
func NewConfigCLI ¶
NewConfigCLI loads configuration parameters from command-line
func NewConfigDefaults ¶
NewConfigDefaults loads configuration parameters from defaults
func NewConfigENV ¶
NewConfigENV loads configuration parameters from enviroment
func NewConfigYAML ¶
NewConfigYAML loads configuration parameters from YAML file
type ConfigApp ¶
type ConfigApp struct {
ConfigFile *string `envconfig:"TFD_CONFIG_FILE" long:"config_file" description:"Path to the config file" default-mask:"not set"` // core parameter
ListenHost *string `` /* 146-byte string literal not displayed */
ListenPort *uint16 `` /* 126-byte string literal not displayed */
ReloadIntervalInSec *int `` /* 252-byte string literal not displayed */
MaxAutoReloadDurationInSec *int `` /* 213-byte string literal not displayed */
UploadTimeoutInSec *int `` /* 204-byte string literal not displayed */
DefaultModelLabel *string `` /* 161-byte string literal not displayed */
Discovery *string `` /* 230-byte string literal not displayed */
Storage *string `` /* 220-byte string literal not displayed */
Metadata *string `` /* 205-byte string literal not displayed */
}
ConfigApp holds configuration parameters common to the application
type ConfigDiscovery ¶
type ConfigDiscovery struct {
Plaintext ConfigDiscoveryPlaintext `yaml:"plaintext" group:"Plaintext Discovery Options"`
DNS ConfigDiscoveryDNS `yaml:"dns" group:"DNS Discovery Options"`
}
ConfigDiscovery holds discovery package configuration parameters
type ConfigDiscoveryDNS ¶
type ConfigDiscoveryDNS struct {
ServiceSuffix *string `` // allowed empty string
/* 202-byte string literal not displayed */
DefaultInstancePort *uint16 `` /* 263-byte string literal not displayed */
}
ConfigDiscoveryDNS holds DNS package configuration parameters
type ConfigDiscoveryPlaintext ¶
type ConfigDiscoveryPlaintext struct {
HostsPath *string `` /* 232-byte string literal not displayed */
}
ConfigDiscoveryPlaintext holds Plaintext package configuration parameters
type ConfigMetadata ¶
type ConfigMetadata struct {
SQLDB ConfigMetadataSQLDB `yaml:"sqldb" group:"SQLDB Metadata Options"`
}
ConfigMetadata holds metadata package configuration parameters
type ConfigMetadataSQLDB ¶
type ConfigMetadataSQLDB struct {
Driver *string `` /* 189-byte string literal not displayed */
DSN *string `` /* 277-byte string literal not displayed */
}
ConfigMetadataSQLDB holds sqldb package configuration parameters
type ConfigStorage ¶
type ConfigStorage struct {
Filesystem ConfigStorageFilesystem `yaml:"filesystem" group:"Filesystem Storage Options"`
}
ConfigStorage holds storage package configuration parameters
type ConfigStorageFilesystem ¶
type ConfigStorageFilesystem struct {
Base ConfigStorageFilesystemBase `yaml:"base"`
Model ConfigStorageFilesystemModel `yaml:"model"`
Module ConfigStorageFilesystemModule `yaml:"module"`
}
ConfigStorageFilesystem holds filesystem configuration parameters
func (ConfigStorageFilesystem) ConvertPerms ¶
func (ConfigStorageFilesystem) ConvertPerms(perms string) (os.FileMode, error)
ConvertPerms converts string permission to FileMode
type ConfigStorageFilesystemBase ¶
type ConfigStorageFilesystemBase struct {
BasePath *string `` /* 257-byte string literal not displayed */
}
type ConfigStorageFilesystemModel ¶
type ConfigStorageFilesystemModel struct {
ArchiveName *string `` /* 212-byte string literal not displayed */
BasePath *string `` /* 213-byte string literal not displayed */
ConfigName *string `` /* 205-byte string literal not displayed */
EmptyConfigName *string `` /* 219-byte string literal not displayed */
IncomingArchivePath *string `` /* 277-byte string literal not displayed */
DirectoryPermissions *string `` /* 236-byte string literal not displayed */
FilePermissions *string `` /* 216-byte string literal not displayed */
}
ConfigStorageFilesystemModel holds model configuration parameters
type ConfigStorageFilesystemModule ¶
type ConfigStorageFilesystemModule struct {
ArchiveName *string `` /* 217-byte string literal not displayed */
BasePath *string `` /* 218-byte string literal not displayed */
IncomingArchivePath *string `` /* 282-byte string literal not displayed */
DirectoryPermissions *string `` /* 239-byte string literal not displayed */
FilePermissions *string `` /* 219-byte string literal not displayed */
}
ConfigStorageFilesystemModule holds module configuration parameters
type ErrorBody ¶
type ErrorBody struct {
Error ErrorDetails `json:"error_details"`
}
type ErrorDetails ¶
type LabelChanged ¶
type LabelChanged struct {
ServableID
Label string
PreviousVersion int64
NewVersion int64
}
type ModelData ¶
type ModelData struct {
ModelID
ID int64 `json:"id"`
Status string `json:"status"`
Created string `json:"created,omitempty"`
Updated string `json:"updated,omitempty"`
}
ModelData
type ModelID ¶
type ModelID struct {
ServableID
Version int64 `json:"version"`
Label string `json:"label,omitempty"`
}
ModelID is struct to simply hold basic informations using in most application endpoints and functions
func (ModelID) IsVersionSet ¶
IsVersionSet checks if version is set
type ModuleData ¶
type ModuleData struct {
ModuleID
ID int64 `json:"id"`
Created string `json:"created,omitempty"`
Updated string `json:"updated,omitempty"`
}
ModuleData
type ModuleID ¶
type ModuleID struct {
ServableID
Version int64 `json:"version"`
}
ModuleID is struct to simply hold basic informations using in most application endpoints and functions
func (ModuleID) IsVersionSet ¶
IsVersionSet checks if version is set
type ReloadResponse ¶
type ReloadResponse struct {
}
type Response ¶
type Response struct {
ResponseStatus
ResponseData interface{} `json:"output"`
}
type ResponseModel ¶
type ResponseModule ¶
type ResponseStatus ¶
type ServableID ¶
type ServableID struct {
Team string `json:"team"`
Project string `json:"project"`
Name string `json:"name"`
}
func (ServableID) ArchiveName ¶
func (s ServableID) ArchiveName(prefix string, version int64) string
func (ServableID) InstanceHost ¶
func (s ServableID) InstanceHost(suffix string) string
func (ServableID) InstanceName ¶
func (s ServableID) InstanceName() string
type ServableInstances ¶
type ServableInstances struct {
ServableID
Instances []string
}