memos

package
v0.95.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package memos implements the Memos adapter for the memo capability.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() memosvc.Service

New creates an Adapter using the default provider client (reads config from YAML). Returns nil when the provider is not configured.

func NewWithClient

func NewWithClient(c client) memosvc.Service

NewWithClient creates an Adapter with a specific client, useful for testing.

Types

type Adapter

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

Adapter implements memosvc.Service using the Memos provider client.

func (*Adapter) Create

func (a *Adapter) Create(ctx context.Context, content, visibility string) (*ability.Memo, error)

Create creates a new memo with the given content and visibility.

func (*Adapter) Delete

func (a *Adapter) Delete(ctx context.Context, name string) error

Delete removes a memo by its resource name.

func (*Adapter) Get

func (a *Adapter) Get(ctx context.Context, name string) (*ability.Memo, error)

Get returns a single memo by its resource name.

func (*Adapter) HealthCheck

func (a *Adapter) HealthCheck(ctx context.Context) (bool, error)

HealthCheck reports whether the memo backend is reachable by querying the current user endpoint.

func (*Adapter) List

List returns a paginated list of memos.

func (*Adapter) ListRawEvents

func (a *Adapter) ListRawEvents(ctx context.Context, cursor string) ([]any, string, error)

ListRawEvents lists memos as raw events for polling support.

func (*Adapter) Update

func (a *Adapter) Update(ctx context.Context, name string, data map[string]any) (*ability.Memo, error)

Update updates a memo's fields identified by the data map. Supported keys: content, visibility, pinned.

type Webhook

type Webhook struct{}

Webhook implements ability.WebhookConverter for Memos. The Memos webhook sends JSON payloads without authentication headers, so VerifySignature is a no-op by default.

func NewWebhook

func NewWebhook() *Webhook

NewWebhook creates a Webhook for the Memos provider.

func (*Webhook) Convert

func (*Webhook) Convert(body []byte, _ map[string]string) ([]types.DataEvent, error)

Convert transforms the raw Memos webhook body into DataEvent records.

func (*Webhook) VerifySignature

func (*Webhook) VerifySignature(_ map[string]string, _ []byte) error

VerifySignature validates the incoming webhook request. Memos does not send authentication headers, so this is a no-op that always succeeds. Users who need authentication should place a reverse proxy between Memos and the webhook receiver.

func (*Webhook) WebhookPath

func (*Webhook) WebhookPath() string

WebhookPath returns the URL path segment for Memos webhooks. The full URL is /webhook/provider/memos/events.

Jump to

Keyboard shortcuts

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