internal

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package internal splits out ImmutableObject into a separate package from storagemem to make it impossible to modify ImmutableObject via direct field access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImmutableObject

type ImmutableObject struct {
	storageutil.ObjectInfo
	// contains filtered or unexported fields
}

ImmutableObject is an object that contains a path, external path, and data that is never modified.

We make this a struct so there is no weirdness with returning a nil interface.

func NewImmutableObject

func NewImmutableObject(
	path string,
	externalPath string,
	data []byte,
) *ImmutableObject

NewImmutableObject returns a new ImmutableObject.

path is expected to always be non-empty. If externalPath is empty, normalpath.Unnormalize(path) is used.

func (*ImmutableObject) Data

func (i *ImmutableObject) Data() []byte

Data returns the data.

DO NOT MODIFY.

Jump to

Keyboard shortcuts

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