federation

package
v0.0.0-...-06831c0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer, o options.FederationOpt) *Encoder

func (Encoder) Encode

func (e Encoder) Encode(payload interface{}, t EncodingFormat) error

Encode the specific format per payload

type EncoderAdapter

type EncoderAdapter interface {
	BuildStructure(io.Writer, options.FederationOpt, interface{}) (interface{}, error)
	BuildData(io.Writer, options.FederationOpt, interface{}) (interface{}, error)
}

type EncoderAdapterActivityStreams

type EncoderAdapterActivityStreams struct{}

func (EncoderAdapterActivityStreams) BuildData

func (a EncoderAdapterActivityStreams) BuildData(w io.Writer, o options.FederationOpt, p interface{}) (interface{}, error)

Build an activity streams format from default internal Corteza payload, including the author, activitystreams metadata and paging custom metadata

func (EncoderAdapterActivityStreams) BuildStructure

func (a EncoderAdapterActivityStreams) BuildStructure(w io.Writer, o options.FederationOpt, p interface{}) (interface{}, error)

Build an activity streams format from default internal Corteza payload, including the author, activitystreams metadata and paging custom metadata

type EncoderAdapterCortezaInternal

type EncoderAdapterCortezaInternal struct{}

func (EncoderAdapterCortezaInternal) BuildData

func (a EncoderAdapterCortezaInternal) BuildData(w io.Writer, o options.FederationOpt, p interface{}) (interface{}, error)

Build a default Corteza response

func (EncoderAdapterCortezaInternal) BuildStructure

func (a EncoderAdapterCortezaInternal) BuildStructure(w io.Writer, o options.FederationOpt, p interface{}) (interface{}, error)

Build a default Corteza response

type EncodingFormat

type EncodingFormat int
const (
	ActivityStreamsStructure EncodingFormat = 0
	CortezaInternalStructure EncodingFormat = 1
	ActivityStreamsData      EncodingFormat = 2
	CortezaInternalData      EncodingFormat = 3
)

type ListDataPayload

type ListDataPayload struct {
	NodeID   uint64
	ModuleID uint64
	Filter   *ct.RecordFilter `json:"filter"`
	Set      *ct.RecordSet    `json:"set"`
}

type ListStructurePayload

type ListStructurePayload struct {
	NodeID uint64
	Filter *types.ExposedModuleFilter `json:"filter"`
	Set    *types.ExposedModuleSet    `json:"set"`
}

type ResponseWrapper

type ResponseWrapper struct {
	Response interface{} `json:"response"`
}

Jump to

Keyboard shortcuts

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