Documentation
¶
Index ¶
- Constants
- Variables
- func MakeBadRequest(err error) *goa.ServiceError
- func MakeForbidden(err error) *goa.ServiceError
- func MakeInternalServerError(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func MakeUnauthorized(err error) *goa.ServiceError
- func NewAttachToAccountEndpoint(s Service, authJWTFn security.AuthJWTFunc, ...) goa.Endpoint
- func NewDetachFromAccountEndpoint(s Service, authJWTFn security.AuthJWTFunc, ...) goa.Endpoint
- func NewReceiveEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
- func NewRegisterURLEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
- func NewViewedUserMedia(res *UserMedia, view string) *facebookviews.UserMedia
- type AttachToAccountPayload
- type Auther
- type Client
- func (c *Client) AttachToAccount(ctx context.Context, p *AttachToAccountPayload) (res string, err error)
- func (c *Client) DetachFromAccount(ctx context.Context, p *DetachFromAccountPayload) (err error)
- func (c *Client) Receive(ctx context.Context, p *ReceivePayload) (res *UserMedia, err error)
- func (c *Client) RegisterURL(ctx context.Context, p *RegisterURLPayload) (res string, err error)
- type DetachFromAccountPayload
- type Endpoints
- type ReceivePayload
- type RegisterURLPayload
- type Service
- type UserMedia
Constants ¶
const ServiceName = "facebook"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [4]string{"register-url", "attach-to-account", "detach-from-account", "receive"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func MakeBadRequest ¶
func MakeBadRequest(err error) *goa.ServiceError
MakeBadRequest builds a goa.ServiceError from an error.
func MakeForbidden ¶
func MakeForbidden(err error) *goa.ServiceError
MakeForbidden builds a goa.ServiceError from an error.
func MakeInternalServerError ¶
func MakeInternalServerError(err error) *goa.ServiceError
MakeInternalServerError builds a goa.ServiceError from an error.
func MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func MakeUnauthorized ¶
func MakeUnauthorized(err error) *goa.ServiceError
MakeUnauthorized builds a goa.ServiceError from an error.
func NewAttachToAccountEndpoint ¶
func NewAttachToAccountEndpoint(s Service, authJWTFn security.AuthJWTFunc, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
NewAttachToAccountEndpoint returns an endpoint function that calls the method "attach-to-account" of service "facebook".
func NewDetachFromAccountEndpoint ¶
func NewDetachFromAccountEndpoint(s Service, authJWTFn security.AuthJWTFunc, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
NewDetachFromAccountEndpoint returns an endpoint function that calls the method "detach-from-account" of service "facebook".
func NewReceiveEndpoint ¶
func NewReceiveEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
NewReceiveEndpoint returns an endpoint function that calls the method "receive" of service "facebook".
func NewRegisterURLEndpoint ¶
func NewRegisterURLEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
NewRegisterURLEndpoint returns an endpoint function that calls the method "register-url" of service "facebook".
func NewViewedUserMedia ¶
func NewViewedUserMedia(res *UserMedia, view string) *facebookviews.UserMedia
NewViewedUserMedia initializes viewed result type UserMedia from result type UserMedia using the given view.
Types ¶
type AttachToAccountPayload ¶
AttachToAccountPayload is the payload type of the facebook service attach-to-account method.
type Auther ¶
type Auther interface {
// APIKeyAuth implements the authorization logic for the APIKey security scheme.
APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)
// JWTAuth implements the authorization logic for the JWT security scheme.
JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error)
}
Auther defines the authorization functions to be implemented by the service.
type Client ¶
type Client struct {
RegisterURLEndpoint goa.Endpoint
AttachToAccountEndpoint goa.Endpoint
DetachFromAccountEndpoint goa.Endpoint
ReceiveEndpoint goa.Endpoint
}
Client is the "facebook" service client.
func (*Client) AttachToAccount ¶
func (c *Client) AttachToAccount(ctx context.Context, p *AttachToAccountPayload) (res string, err error)
AttachToAccount calls the "attach-to-account" endpoint of the "facebook" service. AttachToAccount may return the following errors:
- "InternalServerError" (type *goa.ServiceError)
- error: internal error
func (*Client) DetachFromAccount ¶
func (c *Client) DetachFromAccount(ctx context.Context, p *DetachFromAccountPayload) (err error)
DetachFromAccount calls the "detach-from-account" endpoint of the "facebook" service. DetachFromAccount may return the following errors:
- "NotFound" (type *goa.ServiceError)
- "Forbidden" (type *goa.ServiceError)
- "InternalServerError" (type *goa.ServiceError)
- error: internal error
func (*Client) Receive ¶
Receive calls the "receive" endpoint of the "facebook" service. Receive may return the following errors:
- "Unauthorized" (type *goa.ServiceError)
- "BadRequest" (type *goa.ServiceError)
- "InternalServerError" (type *goa.ServiceError)
- error: internal error
func (*Client) RegisterURL ¶
RegisterURL calls the "register-url" endpoint of the "facebook" service. RegisterURL may return the following errors:
- "InternalServerError" (type *goa.ServiceError)
- error: internal error
type DetachFromAccountPayload ¶
DetachFromAccountPayload is the payload type of the facebook service detach-from-account method.
type Endpoints ¶
type Endpoints struct {
RegisterURL goa.Endpoint
AttachToAccount goa.Endpoint
DetachFromAccount goa.Endpoint
Receive goa.Endpoint
}
Endpoints wraps the "facebook" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "facebook" service with endpoints.
type ReceivePayload ¶
type ReceivePayload struct {
Code *string
State *string
Authorization *string
XSession *string
APIKey *string
RedirectURL *string
}
ReceivePayload is the payload type of the facebook service receive method.
type RegisterURLPayload ¶
type RegisterURLPayload struct {
APIKey *string
}
RegisterURLPayload is the payload type of the facebook service register-url method.
type Service ¶
type Service interface {
// Gets the URL the front-end should redirect the browser to in order to be
// authenticated with Facebook, and then register
RegisterURL(context.Context, *RegisterURLPayload) (res string, err error)
// Attaches a Facebook account to an existing user account, returns the URL the
// browser should be redirected to
AttachToAccount(context.Context, *AttachToAccountPayload) (res string, err error)
// Detaches a Facebook account from an existing user account.
DetachFromAccount(context.Context, *DetachFromAccountPayload) (err error)
// The endpoint that Facebook redirects the browser to after the user has
// authenticated
Receive(context.Context, *ReceivePayload) (res *UserMedia, err error)
}
Service is the facebook service interface.
type UserMedia ¶
type UserMedia struct {
// Unique unchanging user ID
ID string
// Given name for the user
FirstName string
// Family name for the user
LastName string
// Email attached to the account of the user
Email string
// Phone Number Of the user
Phone string
// When the user attempts to change their email, this is what they will change
// it to after they verify that it belongs to them
ChangingEmail *string
// Whether the user has verified their email
VerifiedEmail bool
// Whether the user is an administrator on the site
IsAdmin *bool
UpdatedAt *string
IsActive *bool
CreatedAt *string
CountryPhoneCode *string
Authorization string
XSession string
}
UserMedia is the result type of the facebook service receive method.
func NewUserMedia ¶
func NewUserMedia(vres *facebookviews.UserMedia) *UserMedia
NewUserMedia initializes result type UserMedia from viewed result type UserMedia.