Documentation ¶
Index ¶
- func DefaultBSONRegistry() *bsoncodec.Registry
- func NewOrderedBSONRegistry() *bsoncodec.Registry
- type LogEntries
- func (l LogEntries) AnyArray() []interface{}
- func (l LogEntries) AttachSig(sigStr string)
- func (l LogEntries) DetachSig() string
- func (l LogEntries) Hash() ([]byte, error)
- func (l LogEntries) Len() int
- func (l LogEntries) Less(i, j int) bool
- func (l LogEntries) Sign(prv *rsa.PrivateKey) (string, error)
- func (l LogEntries) Sort()
- func (l LogEntries) Swap(i, j int)
- func (l LogEntries) Verify(sigStr string, pub *rsa.PublicKey) error
- type LogEntry
- type Parser
- type Server
- type VerificationResult
- type Verifier
- type ZapProductionParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultBSONRegistry ¶
DefaultBSONRegistry returns the default BSON registry being used by ProvenLogs
func NewOrderedBSONRegistry ¶
NewOrderedBSONRegistry creates a default BSON registry that encodes a map into an ordered BSON doc with its keys sorted in string order
Types ¶
type LogEntries ¶
type LogEntries []LogEntry
LogEntries represents a slice of log entries
func (LogEntries) AnyArray ¶
func (l LogEntries) AnyArray() []interface{}
AnyArray returns the `[]interface{}` version of the LogEntries
func (LogEntries) AttachSig ¶
func (l LogEntries) AttachSig(sigStr string)
AttachSig attaches the given RSA signature to the last log entry
func (LogEntries) DetachSig ¶
func (l LogEntries) DetachSig() string
DetachSig detaches the RSA signature from the last log entry and returns it
func (LogEntries) Hash ¶
func (l LogEntries) Hash() ([]byte, error)
Hash returns the LogEntries' SHA256 hash
func (LogEntries) Less ¶
func (l LogEntries) Less(i, j int) bool
Less reports whether the LogEntry with index i should sort before the LogEntry with index j
func (LogEntries) Sign ¶
func (l LogEntries) Sign(prv *rsa.PrivateKey) (string, error)
Sign signs the LogEntries using the given RSA private key and returns a base64 encoded RSA signature
func (LogEntries) Sort ¶
func (l LogEntries) Sort()
Sort sorts the LogEntries in chronological order of its entries' timestamps
func (LogEntries) Swap ¶
func (l LogEntries) Swap(i, j int)
Swap swaps the LogEntries with indexes i and j
type LogEntry ¶
type LogEntry struct { PDBMetadata *provendb.Metadata `json:"_provendb_metadata,omitempty" bson:"_provendb_metadata,omitempty"` Timestamp time.Time `json:"timestamp" bson:"timestamp"` Level string `json:"level" bson:"level"` Message string `json:"message" bson:"message"` Data map[string]interface{} `json:"data,omitempty" bson:"data,omitempty"` RSASignature string `json:"_rsa_sig,omitempty" bson:"_rsa_sig,omitempty"` }
LogEntry represents an internal log entry data structure
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a ProvenLogs service instance
type VerificationResult ¶
type VerificationResult struct { RawLog string StoredLog string PubKeyPath string BatchVersion int64 BatchSigHash string BatchSigProof string BatchSigBTCConfirmedTimestamp time.Time BatchSigBTCTxn string BatchSigBTCBlock string }
VerificationResult represents a log entry's verification result
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier represents a ProvenLogs Verifier instance
type ZapProductionParser ¶
type ZapProductionParser struct { TimestampKey, LevelKey, MessageKey string }
ZapProductionParser represents a parser for production logs from Zap logger
func NewZapProductionParser ¶
func NewZapProductionParser() *ZapProductionParser
NewZapProductionParser creates a new parser for production Zap
func (*ZapProductionParser) Parse ¶
func (p *ZapProductionParser) Parse(raw string) LogEntry
Parse parses the given raw log string into a log entry