utils

package
v0.27.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAttributeHeaderPrefix = "X-Attribute-"
)

Variables

This section is empty.

Functions

func BackwardTransformIfSystem

func BackwardTransformIfSystem(key string) string

func GetContainerID

func GetContainerID(ctx context.Context, containerID string, resolver *resolver.ContainerResolver) (*cid.ID, error)

GetContainerID decode container id, if it's not a valid container id then trey to resolve name using provided resolver.

func PrepareExpirationHeader

func PrepareExpirationHeader(ctx context.Context, p *pool.Pool, headers map[string]string, now time.Time) error

func TransformIfSystem

func TransformIfSystem(key []byte) []byte

Types

type AppParams

type AppParams struct {
	Logger   *zap.Logger
	Pool     *pool.Pool
	Owner    *user.ID
	Resolver *resolver.ContainerResolver
}

type EpochDurations

type EpochDurations struct {
	CurrentEpoch  uint64
	MsPerBlock    int64
	BlockPerEpoch uint64
}

func GetEpochDurations

func GetEpochDurations(ctx context.Context, p *pool.Pool) (*EpochDurations, error)

Jump to

Keyboard shortcuts

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