ap

package
v0.0.0-...-463ea8d Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ProjectURL = vocab.IRI("https://github.com/go-ap/fedbox")
)

Variables

This section is empty.

Functions

func AddKeyToItem

func AddKeyToItem(metaSaver MetadataStorage, it vocab.Item, pair KeyPair) error

func AddKeyToPerson

func AddKeyToPerson(metaSaver storage.MetadataStorage, pair KeyPair) func(act *vocab.Actor) error

func ByName

func ByName(names ...string) url.Values

func ByType

func ByType(types ...vocab.ActivityVocabularyType) url.Values

func ByURL

func ByURL(urls ...vocab.IRI) url.Values

func DefaultServiceIRI

func DefaultServiceIRI(baseURL string) vocab.IRI

func EncodeKeyPair

func EncodeKeyPair(p KeyPair) (pem.Block, pem.Block, error)

func GenerateID

func GenerateID(it vocab.Item, partOf vocab.IRI, by vocab.Item) (vocab.ID, error)

GenerateID generates a unique identifier for the 'it' vocab.Item.

func IRIWithFilters

func IRIWithFilters(iri vocab.IRI, searchParams ...url.Values) vocab.IRI

func KeyGenerator

func KeyGenerator(metaSaver storage.MetadataStorage, typ KeyType) func(act *vocab.Actor) error

func LoadActor

func LoadActor(st processing.ReadStore, iri vocab.IRI, ff ...filters.Check) (vocab.Actor, error)

func SearchActorsIRI

func SearchActorsIRI(baseIRI vocab.IRI, searchParams ...url.Values) vocab.IRI

func Self

func Self(baseURL vocab.IRI, name string) vocab.Service

func WrapObjectInCreate

func WrapObjectInCreate(p vocab.Item, author vocab.Item) vocab.Activity

func WrapObjectInUpdate

func WrapObjectInUpdate(p vocab.Item, author vocab.Item) vocab.Activity

Types

type KeyPair

type KeyPair struct {
	Private crypto.PrivateKey
	Public  crypto.PublicKey
	Type    KeyType
}

func GenerateKeyPair

func GenerateKeyPair(typ KeyType) (*KeyPair, error)

func KeyPairFromPrivateBytes

func KeyPairFromPrivateBytes(prvBytes []byte) (*KeyPair, error)

type KeyType

type KeyType string
const (
	KeyTypeECDSA   KeyType = "ECDSA"
	KeyTypeED25519 KeyType = "ED25519"
	KeyTypeRSA     KeyType = "RSA"
)

type MetadataStorage

type MetadataStorage interface {
	LoadMetadata(vocab.IRI, any) error
	SaveMetadata(vocab.IRI, any) error
}

Jump to

Keyboard shortcuts

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