Documentation
¶
Index ¶
- Constants
- func NewRateLimiter(ctx context.Context, nbPerSecond float64, burst int) *rateLimiter
- type Configuration
- type GetWorkerOptions
- type ItemUnitClientData
- type Service
- func (s *Service) ApplyConfiguration(config interface{}) error
- func (s *Service) CheckConfiguration(config interface{}) error
- func (s *Service) ComputeMetrics(ctx context.Context)
- func (s *Service) Init(config interface{}) (cdsclient.ServiceConfig, error)
- func (s *Service) Serve(c context.Context) error
- func (s *Service) Start(ctx context.Context) error
- func (s *Service) Status(ctx context.Context) *sdk.MonitoringStatus
- type SizeWriter
- type StoreFileOptions
- type WSLine
Constants ¶
View Source
const (
ItemLogGC = 24 * 3600
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct {
Name string `toml:"name" default:"cds-cdn" comment:"Name of this CDS CDN Service\n Enter a name to enable this service" json:"name"`
TCP sdk.TCPServer `toml:"tcp" comment:"######################\n CDS CDN TCP Configuration \n######################" json:"tcp"`
HTTP service.HTTPRouterConfiguration `toml:"http" comment:"######################\n CDS CDN HTTP Configuration \n######################" json:"http"`
URL string `default:"http://localhost:8089" json:"url" comment:"Private URL for communication with API"`
PublicTCP string `toml:"publicTCP" default:"localhost:8090" comment:"Public address to access to CDN TCP server" json:"public_tcp"`
PublicTCPEnableTLS bool `toml:"publicTCPEnableTLS" comment:"Enable TLS on public address to access to CDN TCP server" json:"public_tcp_enable_tls"`
PublicHTTP string `toml:"publicHTTP" default:"http://localhost:8089" comment:"Public address to access to CDN HTTP server" json:"public_http"`
Database database.DBConfiguration `` /* 139-byte string literal not displayed */
Cache struct {
TTL int `toml:"ttl" default:"60" json:"ttl"`
LruSize int64 `toml:"lruSize" default:"134217728" json:"lruSize" comment:"Redis LRU cache for logs items in bytes (default: 128MB)"`
Redis struct {
Host string `` /* 192-byte string literal not displayed */
Password string `toml:"password" json:"-"`
DbIndex int `toml:"dbindex" default:"0" json:"dbindex"`
} `toml:"redis" json:"redis"`
} `toml:"cache" comment:"######################\n CDN Cache Settings \n######################" json:"cache"`
API service.APIServiceConfiguration `toml:"api" comment:"######################\n CDS API Settings \n######################" json:"api"`
Log storage.LogConfig `toml:"log" json:"log" comment:"###########################\n Log settings.\n##########################"`
Units storage.Configuration `` /* 159-byte string literal not displayed */
Metrics struct {
Frequency int64 `toml:"frequency" default:"30" json:"frequency" comment:"each 30s, metrics are computed"`
} `toml:"metrics" comment:"######################\n CDN Metrics Settings \n######################" json:"metrics"`
}
Configuration is the hooks configuration structure
type GetWorkerOptions ¶
type GetWorkerOptions struct {
NeedPrivateKey bool
}
type ItemUnitClientData ¶
type ItemUnitClientData struct {
// contains filtered or unexported fields
}
type Service ¶
type Service struct {
service.Common
Cfg Configuration
DBConnectionFactory *database.DBConnectionFactory
Router *api.Router
Cache cache.Store
LogCache *lru.Redis
Mapper *gorpmapper.Mapper
Units *storage.RunningStorageUnits
WSServer *websocketServer
WSBroker *websocket.Broker
WSEventsMutex sync.Mutex
WSEvents map[string]sdk.CDNWSEvent
Metrics struct {
ItemSize *stats.Int64Measure
ItemToSyncCount *stats.Int64Measure
WSClients *stats.Int64Measure
WSEvents *stats.Int64Measure
ItemToDelete *stats.Int64Measure
ItemUnitToDelete *stats.Int64Measure
// contains filtered or unexported fields
}
// contains filtered or unexported fields
}
Service is the stuct representing a CDN µService
func (*Service) ApplyConfiguration ¶
ApplyConfiguration apply an object of type CDN.Configuration after checking it
func (*Service) CheckConfiguration ¶
CheckConfiguration checks the validity of the configuration object
func (*Service) ComputeMetrics ¶
type SizeWriter ¶
type SizeWriter struct {
Size int64
}
type StoreFileOptions ¶
type StoreFileOptions struct {
DisableApiRunResult bool
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.