model

package
v0.0.0-...-13997a8 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package model contains the type definitions that make up the Data Track disclosure model, with associated functions for creating new objects.

Index

Constants

View Source
const HashOutputLen = 32

HashOutputLen is the output length (in bytes) of Hash(...).

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionDisclose

type ActionDisclose struct {
	Disclosure Disclosure
	Attribute  []Attribute
	Sender     Organization // if empty on first level = user disclosed it
	Recipient  Organization
	Downstream []ActionDisclose
}

ActionDisclose models one disclosure and its potential downstream disclosures that occurred as a consequence of the disclosure.

type Attribute

type Attribute struct {
	ID    string
	Name  string
	Type  string
	Value string
}

Attribute is an attribute.

func MakeAttribute

func MakeAttribute(name, thetype, value string) (Attribute, error)

MakeAttribute creates an attribute.

type Category

type Category struct {
	ID   string
	Type string
}

Category is a category.

type Coordinate

type Coordinate struct {
	ID           string
	Latitude     string
	Longitude    string
	DisclosureID string
	Timestamp    string
}

Coordinate is a coordinate and its associated disclosure ID.

func MakeCoordinate

func MakeCoordinate(latitude, longitude, disclosureID, timestamp string) Coordinate

MakeCoordinate creates a Coordinate.

type Disclosed

type Disclosed struct {
	Disclosure string
	Attribute  []string
}

Disclosed represents the disclosure of several attributes.

type Disclosure

type Disclosure struct {
	ID                   string
	Sender               string
	Recipient            string
	Timestamp            string
	PrivacyPolicyHuman   string
	PrivacyPolicyMachine string
	DataLocation         string
	API                  string
}

Disclosure is a data disclosure.

func MakeDisclosure

func MakeDisclosure(sender string, recipient string, time string, policyHuman string,
	policyMachine string, location string, API string) (Disclosure, error)

MakeDisclosure creates a Disclosure from provided data.

type Downstream

type Downstream struct {
	Origin string
	Result string
}

Downstream represents a relationship between an origin data disclosure and a resulting data disclosure.

type Insert

type Insert struct {
	User        User
	Disclosures []ActionDisclose
}

Insert is an insert into the Data Track of new disclosures.

type Organization

type Organization struct {
	ID          string // popular name
	Name        string // legal name
	Street      string
	Zip         string
	City        string
	State       string
	Country     string
	Telephone   string
	Email       string
	URL         string
	Description string
}

Organization is an organization.

type User

type User struct {
	Name    string
	Picture string
}

User represents a user.

Jump to

Keyboard shortcuts

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