transform_chksum

package
v0.56.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = "hydra/transform/chksum"

ConfigID is the configuration identifier.

Variables

View Source
var (
	ChksumType_name = map[int32]string{
		0: "ChksumType_UNKNOWN",
		1: "ChksumType_CRC32",
	}
	ChksumType_value = map[string]int32{
		"ChksumType_UNKNOWN": 0,
		"ChksumType_CRC32":   1,
	}
)

Enum value maps for ChksumType.

Functions

func DecodeCRC32

func DecodeCRC32(data []byte) ([]byte, error)

DecodeCRC32 is a shortcut for the crc32 checksum transform.

func EncodeCRC32

func EncodeCRC32(data []byte) ([]byte, error)

EncodeCRC32 is a shortcut for the crc32 checksum transform.

Types

type Chksum

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

Chksum is the checksum step.

func NewChksum

func NewChksum(c *Config) (*Chksum, error)

NewChksum constructs the checksum step.

func (*Chksum) DecodeBlock

func (s *Chksum) DecodeBlock(data []byte) ([]byte, error)

DecodeBlock decodes the block according to the config. May reuse the same byte slice if possible.

func (*Chksum) EncodeBlock

func (s *Chksum) EncodeBlock(data []byte) ([]byte, error)

EncodeBlock encodes the block according to the config. May reuse the same byte slice if possible.

type ChksumType

type ChksumType int32

ChksumType is the checksum type enum.

const (
	// ChksumType_UNKNOWN defaults to CRC64.
	ChksumType_ChksumType_UNKNOWN ChksumType = 0
	// ChksumType_CRC32 performs a appended 4 byte crc32 against the data.
	ChksumType_ChksumType_CRC32 ChksumType = 1
)

func (ChksumType) Enum

func (x ChksumType) Enum() *ChksumType

func (ChksumType) MarshalJSON

func (x ChksumType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ChksumType to JSON.

func (ChksumType) MarshalProtoJSON

func (x ChksumType) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ChksumType to JSON.

func (ChksumType) MarshalProtoText

func (x ChksumType) MarshalProtoText() string

func (ChksumType) MarshalText

func (x ChksumType) MarshalText() ([]byte, error)

MarshalText marshals the ChksumType to text.

func (ChksumType) String

func (x ChksumType) String() string

func (*ChksumType) UnmarshalJSON

func (x *ChksumType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ChksumType from JSON.

func (*ChksumType) UnmarshalProtoJSON

func (x *ChksumType) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ChksumType from JSON.

func (*ChksumType) UnmarshalText

func (x *ChksumType) UnmarshalText(b []byte) error

UnmarshalText unmarshals the ChksumType from text.

type Config

type Config struct {

	// ChksumType is the type of chksum to use.
	ChksumType ChksumType `protobuf:"varint,1,opt,name=chksum_type,json=chksumType,proto3" json:"chksumType,omitempty"`
	// contains filtered or unexported fields
}

Config configures the snappy transform.

func (*Config) CloneMessageVT

func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Config) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

func (this *Config) EqualMessageVT(thatMsg any) bool

func (*Config) EqualVT

func (this *Config) EqualVT(that *Config) bool

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(other config.Config) bool

EqualsConfig checks if the config is equal to another.

func (*Config) GetChksumType

func (x *Config) GetChksumType() ChksumType

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config.

func (*Config) MarshalJSON

func (x *Config) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Config to JSON.

func (*Config) MarshalProtoJSON

func (x *Config) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Config message to JSON.

func (*Config) MarshalProtoText

func (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Config) MarshalToVT

func (m *Config) MarshalToVT(dAtA []byte) (int, error)

func (*Config) MarshalVT

func (m *Config) MarshalVT() (dAtA []byte, err error)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

func (m *Config) SizeVT() (n int)

func (*Config) String

func (x *Config) String() string

func (*Config) UnmarshalJSON

func (x *Config) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Config from JSON.

func (*Config) UnmarshalProtoJSON

func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Config message from JSON.

func (*Config) UnmarshalVT

func (m *Config) UnmarshalVT(dAtA []byte) error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration. This is a cursory validation to see if the values "look correct."

type StepFactory

type StepFactory struct{}

StepFactory constructs the transform step.

func NewStepFactory

func NewStepFactory() *StepFactory

NewStepFactory constructs the factory object.

func (*StepFactory) Construct

func (f *StepFactory) Construct(
	conf config.Config, opts controller.ConstructOpts,
) (block_transform.Step, error)

Construct constructs the associated transform step given configuration.

func (*StepFactory) ConstructConfig

func (f *StepFactory) ConstructConfig() config.Config

ConstructConfig constructs an instance of the transform configuration.

func (*StepFactory) ConstructMockConfig

func (f *StepFactory) ConstructMockConfig() []config.Config

ConstructMockConfig constructs an instance of the transform configuration for testing.

func (*StepFactory) GetConfigID

func (f *StepFactory) GetConfigID() string

GetConfigID returns the unique config ID for the transform step.

Jump to

Keyboard shortcuts

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