reddit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package reddit provides tools for Reddit via the official REST API.

Authentication: Reddit OAuth2 app (script or web type). Required env vars:

REDDIT_CLIENT_ID      — app client ID
REDDIT_CLIENT_SECRET  — app client secret
REDDIT_USERNAME       — Reddit username (for script apps)
REDDIT_PASSWORD       — Reddit password (for script apps)

Tools planned (see GitHub issue):

reddit_search     — search posts across Reddit or in a specific subreddit
reddit_posts      — list hot/new/top/rising posts from a subreddit
reddit_post       — fetch a single post with comments
reddit_submit     — submit a post or comment (requires auth)
reddit_subreddit  — fetch subreddit info and rules

Index

Constants

View Source
const (
	SearchToolName    = "reddit_search"
	SearchDisplayName = "Search Reddit"
	SearchDescription = `` /* 408-byte string literal not displayed */

)
View Source
const (
	PostsToolName    = "reddit_posts"
	PostsDisplayName = "Reddit Subreddit Posts"
	PostsDescription = `` /* 307-byte string literal not displayed */

)

Variables

View Source
var ErrNotImplemented = errors.New("reddit tools: not implemented — see GitHub issue")

ErrNotImplemented is returned by all Reddit tools until the OAuth client and API integration are complete (see GitHub issue).

Functions

This section is empty.

Types

type PostsTool

type PostsTool struct{}

func NewPostsTool

func NewPostsTool() *PostsTool

func (*PostsTool) BackfillInput

func (t *PostsTool) BackfillInput(_ context.Context, input map[string]any) map[string]any

func (*PostsTool) Call

func (*PostsTool) CheckPermissions

func (t *PostsTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*PostsTool) Definition

func (t *PostsTool) Definition() tool.Definition

func (*PostsTool) Description

func (t *PostsTool) Description(_ context.Context) (string, error)

func (*PostsTool) FormatResult

func (t *PostsTool) FormatResult(data any) string

func (*PostsTool) IsConcurrencySafe

func (t *PostsTool) IsConcurrencySafe(_ map[string]any) bool

func (*PostsTool) IsEnabled

func (t *PostsTool) IsEnabled() bool

func (*PostsTool) IsReadOnly

func (t *PostsTool) IsReadOnly(_ map[string]any) bool

func (*PostsTool) ValidateInput

func (t *PostsTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)

type SearchTool

type SearchTool struct{}

func NewSearchTool

func NewSearchTool() *SearchTool

func (*SearchTool) BackfillInput

func (t *SearchTool) BackfillInput(_ context.Context, input map[string]any) map[string]any

func (*SearchTool) Call

func (*SearchTool) CheckPermissions

func (t *SearchTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*SearchTool) Definition

func (t *SearchTool) Definition() tool.Definition

func (*SearchTool) Description

func (t *SearchTool) Description(_ context.Context) (string, error)

func (*SearchTool) FormatResult

func (t *SearchTool) FormatResult(data any) string

func (*SearchTool) IsConcurrencySafe

func (t *SearchTool) IsConcurrencySafe(_ map[string]any) bool

func (*SearchTool) IsEnabled

func (t *SearchTool) IsEnabled() bool

func (*SearchTool) IsReadOnly

func (t *SearchTool) IsReadOnly(_ map[string]any) bool

func (*SearchTool) ValidateInput

func (t *SearchTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)

Jump to

Keyboard shortcuts

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