helpers

package
v0.0.0-...-34a32d4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: GPL-3.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const TIME_FORMAT = "2006-01-02T15:04:05Z"

TIME_FORMAT is the required time format for the Diaspora protocol

Variables

This section is empty.

Functions

func ExractSignatureText

func ExractSignatureText(order string, entity interface{}) (signatureOrder []string)

ExractSignatureText is used to extract order information about xml elements this is required to sign and verify Diaspora author signatures

func GuidToLink(guid string) (string, error)

func LinkToGuid

func LinkToGuid(link string) string

func ParseActorHandle

func ParseActorHandle(handle string) (string, error)

func ParseHandle

func ParseHandle(handle string) (string, error)

func ParseRSAPrivateKey

func ParseRSAPrivateKey(decodedKey []byte) (*rsa.PrivateKey, error)

ParseRSAPublicKey transforms a serialized private key into a rsa.PrivateKey

func ParseRSAPublicKey

func ParseRSAPublicKey(decodedKey []byte) (*rsa.PublicKey, error)

ParseRSAPublicKey transforms a serialized public key into a rsa.PublicKey

func ParseStringHelper

func ParseStringHelper(line, regex string, max int) (parts []string, err error)

func ParseWebfingerHandle

func ParseWebfingerHandle(handle string) (string, error)

ParseWebfingerHandle will parse a handle in webfinger format e.g. acct:lukas@sechat.org

func Token

func Token() (string, error)

Token is similiar to Uuid() but instead of 16 it uses 32 bytes

func Uuid

func Uuid() (string, error)

Uuid generates a [16]byte string to seperate and identify entities

Types

type ReadOnlyBool

type ReadOnlyBool bool

ReadOnlyBool will not be affected by json.Unmarshal and can therefore be presetted before the task is invoked

func (ReadOnlyBool) UnmarshalJSON

func (ReadOnlyBool) UnmarshalJSON([]byte) error

type Time

type Time string

Time will be used for xml/json marshal and unmarshal

func (*Time) New

func (t *Time) New(newTime time.Time) *Time

New generates a protocol-friendly time from a normal time.Time struct

func (Time) String

func (t Time) String() string

String returns a serialized protocol time

func (Time) Time

func (t Time) Time() (time.Time, error)

Time parses the protocol time and returns time.Time

Jump to

Keyboard shortcuts

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