Documentation
¶
Overview ¶
Package link defines services capable of linking keys to users.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Github = &github{}
Github service.
View Source
var HTTPS = &https{}
HTTPS service.
View Source
var Reddit = &reddit{}
Reddit service.
View Source
var Twitter = &twitter{}
Twitter service.
Functions ¶
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 {
// Identifier of the service, e.g. "github", "twitter".
ID() string
// Normalize the service user name.
// For example, on Twitter, "@username" becomes "username" or "Gabriel"
// becomes "gabriel".
NormalizeName(name string) string
// ValidateName validates the service user name.
ValidateName(name string) error
// NormalizeURLString normalizes an url string.
NormalizeURLString(name string, urs string) (string, error)
// ValidateURLString validates the URL string and returns where to find the
// signed statement.
// For example, on reddit ".json" is appended.
ValidateURLString(name string, urs string) (string, error)
// CheckContent returns data with statement.
// For Twitter, Github there is no check since the user owns the URL location.
// For Reddit, we need to verify the listing, author and subreddit and return only the listing text.
CheckContent(name string, b []byte) ([]byte, error)
}
Service describes a user service.
func NewService ¶
NewService returns a service by name.
Click to show internal directories.
Click to hide internal directories.