model

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	// ID contains the ID of this endpoint. It must be unique for the vendor.
	ID types.EndpointID `json:"id"`
	// VendorID contains the ID of the vendor which owns this endpoint.
	VendorID core.PartyID `json:"vid"`
	// NotBefore contains the date/time indicating from when the endpoint could be used.
	NotBefore time.Time `json:"nbf"`
	// Expiry contains the date/time on or after which the service should not be used anymore. Optional.
	Expiry *time.Time `json:"exp,omitempty"`
	// Location contains the URL exposed by this endpoint.
	Location URL `json:"loc"`
	// Type contains the type of this endpoint
	Type OIDURNValue `json:"type"`
}

Endpoint is a JSON marshalable implementation of an endpoint as specified by RFC006 Distributed Registry.

type OIDURNValue

type OIDURNValue struct {
	// contains filtered or unexported fields
}

OIDURNValue is a URN in the OID scheme in the format of `urn:oid:(some-oid):(some-value)`

func NewOIDURNValue

func NewOIDURNValue(oid string, value string) (OIDURNValue, error)

NewOIDURNValue constructs a new OIDURNValue given the OID (e.g. `1.2.3.4`) and value (e.g. `some-value`).

func (OIDURNValue) MarshalJSON

func (e OIDURNValue) MarshalJSON() ([]byte, error)

MarshalJSON marshals the OIDURNValue into a JSON string.

func (OIDURNValue) String

func (e OIDURNValue) String() string

String formats the OIDURNValue as a string.

func (*OIDURNValue) UnmarshalJSON

func (e *OIDURNValue) UnmarshalJSON(bytes []byte) error

UnmarshalJSON unmarshals a JSON string into a OIDURNValue. An error is returned if the format isn't `urn:oid:(some-oid):(some-value)`

type Organization

type Organization struct {
	// ID of the organization
	ID core.PartyID `json:"id"`
	// Name contains the name of this organization.
	Name string `json:"name"`
	// VendorID contains the ID of the vendor that registered this organization.
	VendorID core.PartyID `json:"vid"`
	// Proofs contains the pieces of cryptographically verifiable information that authenticate the organization. (TODO)
	Proofs []Proof `json:"prfs,omitempty"`
}

Organization is a JSON marshalable implementation of an organization as specified by RFC006 Distributed Registry.

type Proof

type Proof interface {
}

Proof is a container for a cryptographic proof (TODO)

type Service

type Service struct {
	// VendorID contains the ID of the vendor which defined this service.
	VendorID core.PartyID `json:"vid"`
	// Organization contains the ID of the organization which offers this service.
	OrganizationID core.PartyID `json:"oid"`
	// Name contains the name of this service. It must be unique for the vendor/organization combination.
	Name string `json:"name"`
	// Endpoints contains an array of ID of endpoints (of the vendor) that are associated with this service.
	Endpoints []types.EndpointID `json:"eps"`
	// NotBefore contains the date/time indicating from when the service could be used.
	NotBefore time.Time `json:"nbf"`
	// Expiry contains the date/time on or after which the service should not be used anymore. Optional.
	Expiry *time.Time `json:"exp,omitempty"`
}

Service is a JSON marshalable implementation of an service as specified by RFC006 Distributed Registry.

type URL

type URL struct {
	url.URL
}

URL wraps url.URL to aid JSON marshaling.

func NewURL

func NewURL(value url.URL) URL

NewURL constructs a new URL wrapped around url.URL.

func (URL) MarshalJSON

func (U URL) MarshalJSON() ([]byte, error)

MarshalJSON marshals the URL into a JSON string.

func (*URL) UnmarshalJSON

func (U *URL) UnmarshalJSON(bytes []byte) error

UnmarshalJSON unmarshals a JSON URL (e.g. "https://nuts.nl"). If the URL can't be parsed or isn't abosolute an error is returned.

type Vendor

type Vendor struct {
	// Certificates contains the CA certificates of the organization
	Certificates []*cert.NutsCertificate `json:"certs"`
	// Proofs contains the pieces of cryptographically verifiable information that authenticate the vendor. (TODO)
	Proofs []Proof `json:"prfs,omitempty"`
}

Vendor is a JSON marshalable implementation of a vendor as specified by RFC006 Distributed Registry.

Jump to

Keyboard shortcuts

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