context

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	SymAlgMode
	SigCreationTime *values.DateTime
	KeyCreationTime *values.DateTime
	// contains filtered or unexported fields
}

Context class fir parsing packets

func New

func New(opts ...OptFunc) *Context

New returns a new Context instance

func (*Context) Armor

func (c *Context) Armor() bool

Armor return flag value of armorFlag

func (*Context) Cert

func (c *Context) Cert() bool

Cert return flag value of certFlag

func (*Context) Debug

func (c *Context) Debug() bool

Debug return flag value of debugFlag

func (*Context) GDump

func (c *Context) GDump() bool

GDump return flag value of gdumpFlag

func (*Context) Get

func (c *Context) Get(code OptCode) bool

Set sets option to Context.

func (*Context) Integer

func (c *Context) Integer() bool

Integer return flag value of intFlag

func (*Context) Literal

func (c *Context) Literal() bool

Literal return flag value of literalFlag

func (*Context) Marker

func (c *Context) Marker() bool

Marker return flag value of markerFlag

func (*Context) Private

func (c *Context) Private() bool

Private return flag value of privateFlag

func (*Context) Set

func (c *Context) Set(code OptCode, f bool)

Set sets option to Context.

func (*Context) String

func (c *Context) String() string

Stringer

func (*Context) UTC

func (c *Context) UTC() bool

UTC return flag value of utcFlag

type OptCode

type OptCode int

Level is log level

const (
	UNKNOWN OptCode = iota //unknown option
	ARMOR                  //accepts ASCII input only
	CERT                   //dumps attested certification in signature packets (tag 2)
	DEBUG                  //for debug
	GDUMP                  //selects alternate (GnuPG type) dump format (not used)
	INTEGER                //dumps multi-precision integers
	LITERAL                //dumps literal packets (tag 11)
	MARKER                 //dumps marker packets (tag 10)
	PRIVATE                //dumps private packets (tag 60-63)
	UTC                    //output UTC time
)

func GetOptCode

func GetOptCode(s string) OptCode

GetOptCode returns OptCode from string

func (OptCode) String

func (oc OptCode) String() string

type OptFunc

type OptFunc func(*Context)

OptFunc is self-referential function for functional options pattern

func Set

func Set(code OptCode, f bool) OptFunc

Set returns closure as type OptFunc

func SetByString

func SetByString(name string, f bool) OptFunc

SetByString returns closure as type OptFunc

type SymAlgMode

type SymAlgMode int

SymAlgMode as Sym. algorithm mode

const (
	//ModeNotSpecified as Not Specified
	ModeNotSpecified SymAlgMode = iota
	//ModeSymEnc as Sym. Encryption Mode
	ModeSymEnc
	//ModePubEnc as Pubkey Encryption Mode
	ModePubEnc
)

func (SymAlgMode) AlgMode

func (mode SymAlgMode) AlgMode() SymAlgMode

AlgMode returns SymAlgMode

func (SymAlgMode) IsPubEnc

func (mode SymAlgMode) IsPubEnc() bool

IsPubEnc is true when mode is ModePubEnc

func (SymAlgMode) IsSymEnc

func (mode SymAlgMode) IsSymEnc() bool

IsSymEnc is true when mode is ModeSymEnc

func (*SymAlgMode) ResetAlg

func (mode *SymAlgMode) ResetAlg()

ResetAlg resets SymAlgMode

func (*SymAlgMode) SetAlgPubEnc

func (mode *SymAlgMode) SetAlgPubEnc()

SetAlgPubEnc sets SymAlgMode to SymAlgModePubEnc

func (*SymAlgMode) SetAlgSymEnc

func (mode *SymAlgMode) SetAlgSymEnc()

SetAlgSymEnc sets SymAlgMode to SymAlgModeSymEnc

func (SymAlgMode) String

func (mode SymAlgMode) String() string

Jump to

Keyboard shortcuts

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