stulbe

package module
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: ISC Imports: 9 Imported by: 1

README

Stulbe client for Go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAuthenticated     = errors.New("not authenticated")
	ErrSubscriptionNotFound = errors.New("subscription not found")
)

Functions

This section is empty.

Types

type AuthRequest added in v0.6.0

type AuthRequest struct {
	User    string `json:"user"`
	AuthKey string `json:"key"`
}

type AuthResponse added in v0.6.0

type AuthResponse struct {
	Ok    bool   `json:"ok"`
	User  string `json:"username"`
	Level string `json:"level"`
	Token string `json:"token"`
}

type Client

type Client struct {
	Endpoint string
	Logger   *zap.Logger
	KV       *kvclient.Client
	// contains filtered or unexported fields
}

Client is a HTTP/Websocket client for the Stulbe API.

func NewClient

func NewClient(options ClientOptions) (*Client, error)

NewClient creates a new client for the Stulbe API

func (*Client) Authenticate

func (s *Client) Authenticate(user string, authKey string) error

func (*Client) Close

func (s *Client) Close()

func (*Client) NewAuthRequest added in v0.4.0

func (s *Client) NewAuthRequest(method string, path string, body io.Reader) (*http.Request, error)

func (*Client) TwitchGetAuthenticationURL added in v0.4.0

func (s *Client) TwitchGetAuthenticationURL() (string, error)

func (*Client) TwitchUserInfo added in v0.4.0

func (s *Client) TwitchUserInfo() (helix.User, error)

type ClientOptions

type ClientOptions struct {
	Endpoint string
	Username string
	AuthKey  string

	Logger *zap.Logger
}

type ResponseError added in v0.6.0

type ResponseError struct {
	Ok    bool   `json:"ok"`
	Error string `json:"error"`
}

type StatusResponse added in v0.6.0

type StatusResponse struct {
	Ok bool `json:"ok"`
}

Jump to

Keyboard shortcuts

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