pkg

package
v0.0.0-...-b0be77f Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateSchema

func CreateOrUpdateSchema(entry Entry, dataset, table string) error

CreateOrUpdateSchema creates a new table in BigQuery. The func detects the project ID from the credentials.

func GetMissingEntries

func GetMissingEntries(dataset, table string) ([]int64, error)

GetMissingEntries returns the missing entries from the BigQuery table. This will be used to fill the missing entries in the BigQuery table by rerunning the missing entries as cron job.

func Insert

func Insert(entry Entry, dataset, table string) error

func Marshal

func Marshal(i interface{}) ([]byte, error)

Marshal is a UTF-8 friendly marshaller. Go's json.Marshal is not UTF-8 friendly because it replaces the valid UTF-8 and JSON characters "&". "<", ">" with the "slash u" unicode escaped forms (e.g. \u0026). It preemptively escapes for HTML friendliness. Where text may include any of these characters, json.Marshal should not be used. Playground of Go breaking a title: https://play.golang.org/p/o2hiX0c62oN

func UpdateTableSchema

func UpdateTableSchema(entry Entry, dataset, table string) error

Types

type Bucket

type Bucket interface {
	UpdateBucket(item Entry) error
}

func NewBucket

func NewBucket(name string) (Bucket, error)

type Entry

type Entry struct {
	IntegratedTime int           `json:"integratedTime"`
	LogID          string        `json:"logID"`
	LogIndex       int           `json:"logIndex"`
	Kind           Kind          `json:"kind"`
	Rekord         *Rekord       `json:"rekord,omitempty"`
	HashedRekord   *Hashedrekord `json:"hashedrekord,omitempty"`
	Intoto         *InToTo       `json:"intoto,omitempty"`
	Date           time.Time     `json:"date"`
}

type Hashedrekord

type Hashedrekord struct {
	Data      RekordData      `json:"data"`
	Signature RekordSignature `json:"signature"`
	// contains filtered or unexported fields
}

type InToTo

type InToTo struct {
	Data      RekordData      `json:"data"`
	Signature RekordSignature `json:"signature"`
	// contains filtered or unexported fields
}

type Kind

type Kind struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
}

type LogSize

type LogSize struct {
	InactiveShards []struct {
		TreeSize int `json:"treeSize"`
	} `json:"inactiveShards"`
	TreeSize int `json:"treeSize"`
}

type Phren

type Phren interface {
	GetLastEntry(dataset, table string) (int64, error)
}

func New

func New() Phren

type RekorDataHash

type RekorDataHash struct {
	Algorithm string `json:"algorithm"`
	Value     string `json:"value"`
}

type Rekord

type Rekord struct {
	Data      RekordData `json:"data"`
	Signature Signature  `json:"signature"`
	// contains filtered or unexported fields
}

type RekordData

type RekordData struct {
	Hash RekorDataHash `json:"hash"`
}

type RekordSignature

type RekordSignature struct {
	PublicKey string `json:"publicKey,omitempty"`
	X509      *X509  `json:"x509,omitempty"`
}

type Signature

type Signature struct {
	Format    string `json:"format,omitempty"`
	PublicKey string `json:"publicKey,omitempty"`
	PGP       string `json:"pgp,omitempty"`
	X509      *X509  `json:"x509,omitempty"`
}

type TLog

type TLog interface {
	Size() (int64, error)
	Entry(index int64) (Entry, error)
}

TLog holds current root hash and size of the merkle tree used to store the log entries.

func NewTLog

func NewTLog(host string) TLog

NewTLog creates an instance of the Tlog.

type Tlog

type Tlog interface {
	Size() (int64, error)
	Entry(index int64) (Entry, error)
}

type X509

type X509 struct {
	Version            int             `json:"version,omitempty"`
	SerialNumber       string          `json:"serial_number,omitempty"`
	SignatureAlgorithm string          `json:"signature_algorithm,omitempty"`
	IssuerOrganization string          `json:"issuer_organization,omitempty"`
	IssuerCommonName   string          `json:"issuer_common_name,omitempty"`
	ValidityNotBefore  time.Time       `json:"validity_not_before,omitempty"`
	ValidityNotAfter   time.Time       `json:"validity_not_after,omitempty"`
	Extensions         []X509Extension `json:"extensions,omitempty"`
}

type X509Extension

type X509Extension struct {
	ID    string `json:"id,omitempty"`
	Value string `json:"value,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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