Documentation ¶
Index ¶
Constants ¶
const ( // DefaultConfigFileName [Constant] DefaultConfigFileName = "huck.yml" // DefaultCounterFileName [Constant] DefaultCounterFileName = "huck.counter.txt" )
const (
// StatisticsFileFormatError [Constant]
StatisticsFileFormatError = "Huck has detected an existing statistics file, but the format is not correct. Please fix it manually."
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
Configuration is the object structure of huck.yml.
func FromConfigFile ¶
func FromConfigFile(filename string) *Configuration
FromConfigFile from huck.yml read data to Configuration struct.
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration to create a empty Configuration struct.
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter statisticians.
func NewCounterHandler ¶
NewCounterHandler to initializer a Counter.
type CounterStorage ¶
type CounterStorage struct {
// contains filtered or unexported fields
}
CounterStorage is Counter persistence device.
func InitCounterStorage ¶
func InitCounterStorage() *CounterStorage
InitCounterStorage to initializer a CounterStorage.
func (*CounterStorage) LoadFromDisk ¶
func (store *CounterStorage) LoadFromDisk(filename string)
LoadFromDisk is Locate the persistent counter from the hard disk and load it into Storage.
func (*CounterStorage) LoadFromString ¶
func (store *CounterStorage) LoadFromString(content string)
LoadFromString is Locate the persistent counter from the String and load it into Storage.
func (*CounterStorage) Save ¶
func (store *CounterStorage) Save(key string, value uint64)
Save the new counter value and persist it. persist is Asynchronous.
type DataStatistical ¶
DataStatistical is a basic statistician common implementation interface.
type Kernel ¶
type Kernel struct {
// contains filtered or unexported fields
}
Kernel have all huck state.
func (*Kernel) ParseConfigHandler ¶
func (hk *Kernel) ParseConfigHandler(conf *Configuration)
ParseConfigHandler is All processors in the parse configuration struct are added to HuckKernel.
func (*Kernel) RegisterHandlerToEcho ¶
func (hk *Kernel) RegisterHandlerToEcho(e *echo.Echo)
RegisterHandlerToEcho is Add all the processors in the HuckKernel to Echo.