trireme-lib: Index | Files

package claimsheader

import ""


Package Files

bytes.go claimsheader.go constants.go ct.go datapath_version.go options.go types.go


const (
    // CompressedTagLengthV1 is version 1 length of tags
    CompressedTagLengthV1 int = 12

    // CompressedTagLengthV2 is version 2 length of tags
    CompressedTagLengthV2 int = 8

func CompressionTypeToTagLength Uses

func CompressionTypeToTagLength(t CompressionType) int

CompressionTypeToTagLength converts CompressionType to length.

type ClaimsHeader Uses

type ClaimsHeader struct {
    // contains filtered or unexported fields

ClaimsHeader holds header sub attributes

func NewClaimsHeader Uses

func NewClaimsHeader(opts ...Option) *ClaimsHeader

NewClaimsHeader returns claims header handler

func (*ClaimsHeader) CompressionType Uses

func (c *ClaimsHeader) CompressionType() CompressionType

CompressionType is the compression type

func (*ClaimsHeader) DatapathVersion Uses

func (c *ClaimsHeader) DatapathVersion() DatapathVersion

DatapathVersion is the datapath version

func (*ClaimsHeader) Encrypt Uses

func (c *ClaimsHeader) Encrypt() bool

Encrypt is the encrypt in bool

func (*ClaimsHeader) SetCompressionType Uses

func (c *ClaimsHeader) SetCompressionType(ct CompressionType)

SetCompressionType sets the compression type

func (*ClaimsHeader) SetDatapathVersion Uses

func (c *ClaimsHeader) SetDatapathVersion(dv DatapathVersion)

SetDatapathVersion sets the datapath version

func (*ClaimsHeader) SetEncrypt Uses

func (c *ClaimsHeader) SetEncrypt(e bool)

SetEncrypt sets the encrypt

func (*ClaimsHeader) ToBytes Uses

func (c *ClaimsHeader) ToBytes() HeaderBytes

ToBytes generates the 32-bit header in bytes

  0             1              2               3               4
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|     D     |CT|E|               R (reserved)                   |
D  [0:5]  - Datapath version
CT [6,7]  - Compressed tag type
E  [8]    - Encryption enabled
R  [9:31] - Reserved

type CompressionType Uses

type CompressionType int

CompressionType defines the compression used.

const (
    // CompressionTypeNone implies no compression
    CompressionTypeNone CompressionType = iota
    // CompressionTypeV1 is version 1 of compression
    // CompressionTypeV2 is version 2 of compression

func String2CompressionType Uses

func String2CompressionType(s string) CompressionType

String2CompressionType is a helper to convert string to compression type

type DatapathVersion Uses

type DatapathVersion int

DatapathVersion defines the datapath version

const (
    DatapathVersion1 DatapathVersion = iota

DatapathVersion constants

type HeaderBytes Uses

type HeaderBytes []byte

HeaderBytes is the claimsheader in bytes

func (HeaderBytes) ToClaimsHeader Uses

func (h HeaderBytes) ToClaimsHeader() *ClaimsHeader

ToClaimsHeader parses the bytes and returns the ClaimsHeader WARNING: Caller has to make sure that headerbytes is NOT nil

type Option Uses

type Option func(*ClaimsHeader)

Option is used to set claimsheader fields

func OptionCompressionType Uses

func OptionCompressionType(compressionType CompressionType) Option

OptionCompressionType sets compression Type

func OptionDatapathVersion Uses

func OptionDatapathVersion(datapathVersion DatapathVersion) Option

OptionDatapathVersion sets handshake version

func OptionEncrypt Uses

func OptionEncrypt(encrypt bool) Option

OptionEncrypt sets encryption

Package claimsheader imports 2 packages (graph) and is imported by 16 packages. Updated 2019-09-21. Refresh now. Tools for package owners.