service

package
v0.0.0-...-04e9793 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToSettingEntity

func MapToSettingEntity(dto *json.SettingsDTO) domain.SettingsEntity

Types

type IHasher

type IHasher interface {
	Hash(data []byte) []byte
}

func NewMD5Hasher

func NewMD5Hasher() IHasher

func NewSHA256Hasher

func NewSHA256Hasher() IHasher

type ILoaderService

type ILoaderService interface {
	LoadComponent(cType string, version string, hash []byte) ([]byte, []byte, error)
}

type LoaderService

type LoaderService struct {
	// contains filtered or unexported fields
}

func NewLoaderService

func NewLoaderService(hasher IHasher, reader *json.Reader, settingsRepo domain.ISettingsRepo, rootPath string) *LoaderService

func (*LoaderService) LoadComponent

func (l *LoaderService) LoadComponent(cType string, version string, expectedHash []byte) ([]byte, []byte, error)

LoadComponent retrieves the binary content and checksum of a component given its type and version.

Parameters:

  • Type: The type of the component to load.
  • Version: The version of the component to load.

Returns:

  • []byte: The binary content of the component.
  • []byte: The checksum or hash for verification.
  • error: An error message if the component could not be loaded.

type MD5Hasher

type MD5Hasher struct{}

func (*MD5Hasher) Hash

func (h *MD5Hasher) Hash(data []byte) []byte

type SHA256Hasher

type SHA256Hasher struct{}

func (*SHA256Hasher) Hash

func (h *SHA256Hasher) Hash(data []byte) []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL