resource

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package resource contains shared primitives for opaque Ferret resource values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Display

func Display(typeName string) string

Display returns the standard display form for an opaque resource type.

func Hash

func Hash(typeName string, id uint64) uint64

Hash returns the stable opaque-resource hash for a type name and ID.

func MarshalDisplayJSON

func MarshalDisplayJSON(typeName string) ([]byte, error)

MarshalDisplayJSON returns the JSON string representation of Display(typeName).

func MarshalStringJSON

func MarshalStringJSON(value string) ([]byte, error)

MarshalStringJSON returns the JSON string representation of value.

Types

type IDGenerator

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

IDGenerator allocates monotonically increasing opaque resource IDs.

func (*IDGenerator) Next

func (g *IDGenerator) Next() uint64

Next returns the next resource ID.

Jump to

Keyboard shortcuts

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