Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Algorithms = []Algorithm{ MD2, MD4, MD5, GOST, SHA1, SHA224, SHA256, SHA384, SHA512, RMD160, SHA3_224, SHA3_256, SHA3_384, SHA3_512, SHA512_224, SHA512_256, BLAKE2s256, BLAKE2b256, BLAKE2b384, BLAKE2b512, SHAKE128, SHAKE256, SM3, }
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm uint8
type BaseSupplier ¶
type BaseSupplier struct { Algorithm Algorithm File *file.File TimeOut int Key string StartTime time.Time IsConcurrent bool // contains filtered or unexported fields }
embedded struct for suppliers
type CommandSupplier ¶
type CommandSupplier struct { BaseSupplier Type CommandType }
Common command executor for openssl or OS apps for unix, max i.e. shaXXXsum application will be called for openssl it is openssl see getCommand method for commands
func (*CommandSupplier) Data ¶
func (s *CommandSupplier) Data() *BaseSupplier
func (*CommandSupplier) Supports ¶
func (s *CommandSupplier) Supports() []Algorithm
check if this runner can run given algo i.e. openssl doesnt have MD2 support
type GoSupplier ¶
type GoSupplier struct {
BaseSupplier
}
Calculates checksum using core go libraries
func (*GoSupplier) Data ¶
func (s *GoSupplier) Data() *BaseSupplier
type ISupplierFactory ¶
type ISupplierFactory interface {
GetSupplierByAlgo(config *Config, algorithm *Algorithm) (Supplier, error)
}
reads the config and returns realted supplier
type Supplier ¶
type Supplier interface { Run() Status() *status.Status Terminate() error Supports() []Algorithm Delete() Data() *BaseSupplier }
Supplier ares main runner for calculation
type SupplierFactory ¶
type SupplierFactory struct { }
factory struct
func (*SupplierFactory) GetSupplierByAlgo ¶
func (factory *SupplierFactory) GetSupplierByAlgo(config *Config, algorithm *Algorithm) (Supplier, error)
returns supplier instance for the given algo and lib i.e. for -lib go -a MD5 it will return GoSupplier to calculate MD5
Click to show internal directories.
Click to hide internal directories.