lesswrong

package
v0.0.0-...-ca2a86b Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Token string
}

Auth represents the results of a successful authentication

type Client

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

Client makes API calls to lesswrong

func NewClient

func NewClient(ctx context.Context, username, password string) (*Client, error)

NewClient authenticates with lesswrong and returns a client

func (*Client) CreatePost

func (c *Client) CreatePost(ctx context.Context, r CreatePostRequest) (*CreatePostResponse, error)

CreatePost creates a new post

func (*Client) User

func (c *Client) User(ctx context.Context, username string) (*User, error)

User fetches information about a user

type CreatePostRequest

type CreatePostRequest struct {
	Title   string // title of the post
	Content string // markdown-formatted post contents
}

type CreatePostResponse

type CreatePostResponse struct {
	URL string `json:"linkUrl"`
}

type User

type User struct {
	Username string
	Email    string
	Bio      string
}

User represents information about a lesswrong user

Jump to

Keyboard shortcuts

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