sdkgo

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: GPL-3.0 Imports: 5 Imported by: 1

README

The “sdkgo”, is a library written in Go and implements foundational principals of OBADA protocol, such as Obit, ObitID, USN and checksum generation.


<<< badges here >>>

Install

Normally you would simply import "github.com/obada-foundation/sdkgo".

Examples

Documentation

Overview

Package sdkgo provides an API for working with OBADA entities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Obit

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

Obit represent asset data structure

func (Obit) GetChecksum

func (o Obit) GetChecksum(parentChecksum *hash.Hash) (hash.Hash, error)

GetChecksum returns Obit checksum

func (Obit) GetDocuments

func (o Obit) GetDocuments() properties.Documents

GetDocuments returns Obit documents

func (Obit) GetManufacturer

func (o Obit) GetManufacturer() properties.StringProperty

GetManufacturer returns manufacturer Obit property

func (Obit) GetObitID

func (o Obit) GetObitID() properties.ObitID

GetObitID returns obit ID

func (Obit) GetPartNumber

func (o Obit) GetPartNumber() properties.StringProperty

GetPartNumber returns part number Obit property

func (Obit) GetSerialNumberHash

func (o Obit) GetSerialNumberHash() properties.StringProperty

GetSerialNumberHash returns serial number hash Obit property

func (Obit) GetTrustAnchorToken

func (o Obit) GetTrustAnchorToken() properties.StringProperty

GetTrustAnchorToken returns OBADA Obit obd DID

type ObitDto

type ObitDto struct {
	ObitIDDto
	TrustAnchorToken string
}

ObitDto todo add description

type ObitIDDto

type ObitIDDto struct {
	SerialNumberHash string `validate:"required"`
	Manufacturer     string `validate:"required"`
	PartNumber       string `validate:"required"`
}

ObitIDDto todo add description

type Sdk

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

Sdk OBADA SDK

func NewSdk

func NewSdk(logger *log.Logger, debug bool) (*Sdk, error)

NewSdk creates a new OBADA SDK instance

func (*Sdk) NewObit

func (sdk *Sdk) NewObit(dto ObitDto) (Obit, error)

NewObit creates new obit

func (*Sdk) NewObitID

func (sdk *Sdk) NewObitID(dto ObitIDDto) (properties.ObitID, error)

NewObitID creates new obit id

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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