result

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Packets []*Item `toml:"Packet,omitempty" json:"Packet,omitempty"`
}

Info is information class for OpenPGP packets

func New

func New() *Info

New returns Info instance

func (*Info) Add

func (i *Info) Add(a *Item)

Add add item in Packets.

func (*Info) JSON

func (i *Info) JSON(indent int) (io.Reader, error)

JSON returns JSON formated string

func (*Info) String

func (i *Info) String() string

Stringer as TOML format

func (*Info) ToString

func (i *Info) ToString(indent string) *bytes.Buffer

ToString returns string buffer

type Item

type Item struct {
	Name  string  `toml:"name" json:"name"`
	Value string  `toml:"value,omitempty" json:"value,omitempty"`
	Dump  string  `toml:"dump,omitempty" json:"dump,omitempty"`
	Note  string  `toml:"note,omitempty" json:"note,omitempty"`
	Items []*Item `toml:"Item,omitempty" json:"Item,omitempty"`
}

Item is information item class

func NewItem

func NewItem(opts ...ItemOpt) *Item

NewItem returns a new Item instance

func (*Item) Add

func (i *Item) Add(a *Item)

Add add sub-item in item.

func (*Item) String

func (i *Item) String() string

type ItemOpt

type ItemOpt func(*Item)

ItemOpt is self-referential function for functional options pattern

func DumpStr

func DumpStr(str string) ItemOpt

DumpStr returns closure as type ItemOpt

func Name

func Name(name string) ItemOpt

Name returns closure as type ItemOpt

func Note

func Note(note string) ItemOpt

Note returns closure as type ItemOpt

func Value

func Value(value string) ItemOpt

Value returns closure as type ItemOpt

Jump to

Keyboard shortcuts

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