simpledoc

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SimpleDocType processor.DocumentType = "simple-doc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleDoc

type SimpleDoc struct {
	Issuer string      `json:"issuer"`
	Info   string      `json:"info,omitempty"`
	Nested []SimpleDoc `json:"nested,omitempty"`
}

type SimpleDocProc

type SimpleDocProc struct{}

SimpleDocProc is a document processor for a simple document It is of JSON blob type

It should have an issuer field, that should match up with issuer URI in TrustInformation

SourceInformation should be propagated

Schema check should include: issuer (required) - string info (optional) - string nested - list of objects that match currnet schema

and no other fields

Example object is

{
	"issuer": "google.com",
	"info": "this is a cool document"
}

Example object with nested is

{
	"issuer": "google.com",
	"info": "this is a cool document",
	"nested": [{
		"issuer": "google.com",
		"info": "this is a cooler nested doc 1"
	},{
		"issuer": "google.com",
		"info": "this is a cooler nested doc 2"
 }]
}

func (*SimpleDocProc) GuessDocumentType

func (_ *SimpleDocProc) GuessDocumentType(blob []byte, f processor.FormatType) processor.DocumentType

func (*SimpleDocProc) Unpack

func (dp *SimpleDocProc) Unpack(d *processor.Document) ([]*processor.Document, error)

func (*SimpleDocProc) ValidateSchema

func (dp *SimpleDocProc) ValidateSchema(d *processor.Document) error

Jump to

Keyboard shortcuts

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