Documentation ¶
Overview ¶
Package services defines services capable of linking a key to a user.
Index ¶
- Constants
- Variables
- func Request(ctx context.Context, client http.Client, urs string, headers []http.Header) (user.Status, []byte, error)
- func SetLogger(l Logger)
- func UpdateResult(ctx context.Context, service Service, result *user.Result, client http.Client, ...)
- func Verify(ctx context.Context, service Service, client http.Client, usr *user.User) *user.Result
- type ContextLogger
- type LogLevel
- type Logger
- type Service
- type Verified
Constants ¶
View Source
const GithubID = "github"
GithubID is id for github.
View Source
const TwitterID = "twitter"
TwitterID is the id for twitter.
Variables ¶
View Source
var Echo = &echo{}
Echo service.
View Source
var Github = &github{}
Github service.
View Source
var HTTPS = &https{}
HTTPS service.
View Source
var KeysPub = &keyspub{}
KeysPub uses keys.pub user cache instead of the service directly.
View Source
var Proxy = &proxy{}
Proxy uses keys.pub user cache instead of the service directly.
View Source
var Reddit = &reddit{}
Reddit service.
View Source
var Twitter = &twitter{ bearerToken: os.Getenv("TWITTER_BEARER_TOKEN"), }
Twitter ..
Functions ¶
func Request ¶
func Request(ctx context.Context, client http.Client, urs string, headers []http.Header) (user.Status, []byte, error)
Request resource.
Types ¶
type ContextLogger ¶
type ContextLogger interface { Debugf(ctx context.Context, format string, args ...interface{}) Infof(ctx context.Context, format string, args ...interface{}) Warningf(ctx context.Context, format string, args ...interface{}) Errorf(ctx context.Context, format string, args ...interface{}) }
ContextLogger interface used in this package with request context.
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warningf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) }
Logger interface used in this package.
type Service ¶
type Service interface { // Request resource with client. Request(ctx context.Context, client http.Client, usr *user.User) (user.Status, []byte, error) // Verify content. Verify(ctx context.Context, b []byte, usr *user.User) (user.Status, *Verified, error) }
Service describes a user service.
Click to show internal directories.
Click to hide internal directories.