sn

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 2 Imported by: 3

README

snappy

A Go client for the Stacker News GraphQL API

How to use

As library:

$ go get github.com/ekzyis/snappy
import sn "github.com/ekzyis/snappy"

As command:

$ go install github.com/ekzyis/snappy/cmd/snappy
$ snappy
  ___ ___  ___ ____  ___  __ __
 (_-</ _ \/ _ `/ _ \/ _ \/ // /
/___/_//_/\_,_/ .__/ .__/\_, /
             /_/  /_/   /___/

Commands:
  query    Query all items of a user.

Usage: snappy query -author <username> [-type all|posts|comments]

SN_API_KEY must be set in your environment for authenticated API access.

How to test

  1. Run SN
  2. Set TEST_SN_BASE_URL and TEST_SN_API_KEY in .env
  3. Run go test ./...

Documentation

Index

Constants

View Source
const (
	PaymentMethodFeeCredits  = t.PaymentMethodFeeCredits
	PaymentMethodOptimistic  = t.PaymentMethodOptimistic
	PaymentMethodPessimistic = t.PaymentMethodPessimistic
)

Variables

View Source
var (
	NewClient    = client.NewClient
	WithApiKey   = client.WithApiKey
	WithBaseUrl  = client.WithBaseUrl
	WithMediaUrl = client.WithMediaUrl
)

Functions

This section is empty.

Types

type Client

type Client = client.Client

type Comment

type Comment = t.Comment

type CreateInvoiceArgs added in v0.5.0

type CreateInvoiceArgs = t.CreateInvoiceArgs

type CreateInvoiceResponse added in v0.5.0

type CreateInvoiceResponse = t.CreateInvoiceResponse

type Dupe

type Dupe = t.Dupe

type DupesError

type DupesError = t.DupesError

type DupesResponse

type DupesResponse = t.DupesResponse

type GetSignedPOST added in v0.6.0

type GetSignedPOST = t.GetSignedPOST

type GetSignedPOSTResponse added in v0.6.0

type GetSignedPOSTResponse = t.GetSignedPOSTResponse

type GqlBody

type GqlBody = t.GqlBody

type GqlError

type GqlError = t.GqlError

type Invoice added in v0.5.0

type Invoice = t.Invoice

type Item

type Item = t.Item

type ItemResponse added in v0.5.0

type ItemResponse = t.ItemResponse

type ItemsCursor

type ItemsCursor = t.ItemsCursor

type ItemsQuery

type ItemsQuery = t.ItemsQuery

type ItemsResponse

type ItemsResponse = t.ItemsResponse

type MeResponse added in v0.7.0

type MeResponse = t.MeResponse

type Notification added in v0.6.0

type Notification = t.Notification

type NotificationsCursor added in v0.6.0

type NotificationsCursor = t.NotificationsCursor

type NotificationsResponse added in v0.6.0

type NotificationsResponse = t.NotificationsResponse

type PayIn added in v0.8.1

type PayIn = t.PayIn

type PaymentMethod added in v0.5.1

type PaymentMethod = t.PaymentMethod

type Rss

type Rss = t.Rss

type RssAuthor

type RssAuthor = t.RssAuthor

type RssChannel

type RssChannel = t.RssChannel

type RssDate

type RssDate = t.RssDate

type RssItem

type RssItem = t.RssItem

type UpsertCommentResponse added in v0.5.2

type UpsertCommentResponse = t.UpsertCommentResponse

type UpsertDiscussionResponse

type UpsertDiscussionResponse = t.UpsertDiscussionResponse

type UpsertLinkResponse

type UpsertLinkResponse = t.UpsertLinkResponse

type User

type User = t.User

type UserPrivates added in v0.7.0

type UserPrivates = t.UserPrivates

Directories

Path Synopsis
cmd
snappy command

Jump to

Keyboard shortcuts

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