json

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(payload any) ([]byte, error)

func MarshalTo

func MarshalTo(ctx context.Context, file string, payload any, options ...MarshalOption) (err error)

func ModifyAfterUnmarshal

func ModifyAfterUnmarshal[T any](modifier func(target *T)) *json.Unmarshalers

func Unmarshal

func Unmarshal(in []byte, out any) error

func UnmarshalFrom

func UnmarshalFrom(ctx context.Context, file string, out any, unmarshalers ...*json.Unmarshalers) (err error)

Types

type MarshalOption

type MarshalOption func(opts *marshalOptions)

func UserOnlyFilePerms

func UserOnlyFilePerms() MarshalOption

UserOnlyFilePerms keeps the file readable and writable by its owner alone. Use it for a file that holds a credential, or a token minted from one.

Jump to

Keyboard shortcuts

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