data

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: GPL-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package data contains OTA service common data object and their methods

Index

Constants

This section is empty.

Variables

View Source
var CorrelationIDNil = CorrelationID(uuid.Nil)

CorrelationIDNil is a nil value of CorrelationID

Functions

func ByteDigest added in v1.0.2

func ByteDigest(content []byte) string

ByteDigest creates sha256 hash of content

func Digest added in v1.0.2

func Digest(content string) string

Digest creates sha256 hash of content

func NewMultiTargetUpdateURN

func NewMultiTargetUpdateURN(id CorrelationID) string

NewMultiTargetUpdateURN creates CorrelationID URN

func NewNamespaceURN

func NewNamespaceURN(id CorrelationID) string

NewNamespaceURN creates Namespace URN

func NewURN

func NewURN(urntype string, id CorrelationID) string

NewURN create new URN

func ToBase64 added in v1.0.2

func ToBase64(val string) ([]byte, error)

ToBase64 convert byte slice to base64 encoded byte slice

func ValidBase64 added in v1.0.14

func ValidBase64(val string) bool

ValidBase64 verifies if str is valid base64

func ValidHex added in v1.0.2

func ValidHex(length int, str string) bool

ValidHex verifies if str is valid hex

Types

type CorrelationID

type CorrelationID uuid.UUID

CorrelationID wrapper on the top of github.com/google/uuid

func CorrelationIDFromString added in v1.0.10

func CorrelationIDFromString(s string) (CorrelationID, error)

CorrelationIDFromString creates a new CorrelationID from a string

func NewChildCorrelationID added in v1.0.7

func NewChildCorrelationID(parent CorrelationID, id string) CorrelationID

NewChildCorrelationID create a new CorrelationID within a parent namespace

func NewCorrelationID

func NewCorrelationID() CorrelationID

NewCorrelationID creates a new CorrelationID

func (*CorrelationID) IsNil added in v1.0.8

func (c *CorrelationID) IsNil() bool

IsNil returns true if the CorrelationID is nil

func (*CorrelationID) MarshalJSON added in v1.1.2

func (c *CorrelationID) MarshalJSON() ([]byte, error)

MarshalJSON custom json serialization func

func (CorrelationID) String

func (c CorrelationID) String() string

String converts CorrelationID to string

func (*CorrelationID) UnmarshalJSON added in v1.1.2

func (c *CorrelationID) UnmarshalJSON(data []byte) error

UnmarshalJSON custom json deserialization func

type Namespace added in v1.0.15

type Namespace string

Namespace is object namespace

func NewNamespace added in v1.0.15

func NewNamespace(id string) Namespace

NewNamespace creates namespace with random uuid

Jump to

Keyboard shortcuts

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