Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: compress #601

Merged
merged 12 commits into from
Aug 27, 2024
Merged

feat: compress #601

merged 12 commits into from
Aug 27, 2024

Conversation

fracasula
Copy link
Collaborator

@fracasula fracasula commented Aug 23, 2024

Description

Adding compress package to support compression via zstd.

Related

Linear Ticket

< Linear_Link >

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@fracasula fracasula changed the title Compress feat: compress Aug 23, 2024
@fracasula fracasula marked this pull request as ready for review August 26, 2024 07:48
go.mod Outdated Show resolved Hide resolved
compress/compress.go Outdated Show resolved Hide resolved
@Sidddddarth
Copy link
Member

LGTM
Just minor observation:
why

	var (
		err   error
		algo  compress.CompressionAlgorithm
		level compress.CompressionLevel
	)
	algo, err = algo.FromString(conf.GetString("Compressor.algorithm", "zstd"))
	if err != nil {
		return nil, fmt.Errorf("invalid compressor algorithm: %w", err)
	}
	level, err = level.FromString(conf.GetString("Compressor.level", "default"))
	if err != nil {
		return nil, fmt.Errorf("invalid compressor level: %w", err)
	}

instead of the usual

        var err error
	algo, err = compress.NewCompressionAlgorithm(conf.GetString("Compressor.algorithm", "zstd"))
	if err != nil {
		return nil, fmt.Errorf("invalid compressor algorithm: %w", err)
	}
	level, err = compress.NewCompressionLevel(conf.GetString("Compressor.level", "default"))
	if err != nil {
		return nil, fmt.Errorf("invalid compressor level: %w", err)
	}

@fracasula fracasula enabled auto-merge (squash) August 27, 2024 12:43
@fracasula fracasula merged commit cda0a40 into main Aug 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants