home: github.com/shurcooL/home/http Index | Files

package http

import "github.com/shurcooL/home/http"

Package http contains service implementations over HTTP.


Package Files

doc.go events.go reactions.go users.go

func NewEvents Uses

func NewEvents(httpClient *http.Client, scheme, host string) events.Service

NewEvents creates a client that implements events.Service remotely over HTTP. If a nil httpClient is provided, http.DefaultClient will be used. scheme and host can be empty strings to target local service.

type Reactions Uses

type Reactions struct{}

Reactions implements reactions.Service remotely over HTTP.

func (Reactions) Get Uses

func (Reactions) Get(ctx context.Context, uri string, id string) ([]reactions.Reaction, error)

func (Reactions) List Uses

func (Reactions) List(ctx context.Context, uri string) (map[string][]reactions.Reaction, error)

func (Reactions) Toggle Uses

func (Reactions) Toggle(ctx context.Context, uri string, id string, tr reactions.ToggleRequest) ([]reactions.Reaction, error)

type Users Uses

type Users struct{}

Users implements users.Service remotely over HTTP.

func (Users) Edit Uses

func (Users) Edit(_ context.Context, er users.EditRequest) (users.User, error)

func (Users) Get Uses

func (Users) Get(ctx context.Context, user users.UserSpec) (users.User, error)

func (Users) GetAuthenticated Uses

func (Users) GetAuthenticated(ctx context.Context) (users.User, error)

func (Users) GetAuthenticatedSpec Uses

func (Users) GetAuthenticatedSpec(ctx context.Context) (users.UserSpec, error)

Package http imports 12 packages (graph) and is imported by 4 packages. Updated 2018-11-14. Refresh now. Tools for package owners.