server

package
v0.0.0-...-5f4f256 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachToAccountFacebookPath

func AttachToAccountFacebookPath() string

AttachToAccountFacebookPath returns the URL path to the facebook service attach-to-account HTTP endpoint.

func DecodeAttachToAccountRequest

func DecodeAttachToAccountRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeAttachToAccountRequest returns a decoder for requests sent to the facebook attach-to-account endpoint.

func DecodeDetachFromAccountRequest

func DecodeDetachFromAccountRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeDetachFromAccountRequest returns a decoder for requests sent to the facebook detach-from-account endpoint.

func DecodeReceiveRequest

func DecodeReceiveRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeReceiveRequest returns a decoder for requests sent to the facebook receive endpoint.

func DecodeRegisterURLRequest

func DecodeRegisterURLRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeRegisterURLRequest returns a decoder for requests sent to the facebook register-url endpoint.

func DetachFromAccountFacebookPath

func DetachFromAccountFacebookPath() string

DetachFromAccountFacebookPath returns the URL path to the facebook service detach-from-account HTTP endpoint.

func EncodeAttachToAccountResponse

func EncodeAttachToAccountResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeAttachToAccountResponse returns an encoder for responses returned by the facebook attach-to-account endpoint.

func EncodeDetachFromAccountResponse

func EncodeDetachFromAccountResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeDetachFromAccountResponse returns an encoder for responses returned by the facebook detach-from-account endpoint.

func EncodeReceiveResponse

func EncodeReceiveResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeReceiveResponse returns an encoder for responses returned by the facebook receive endpoint.

func EncodeRegisterURLResponse

func EncodeRegisterURLResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeRegisterURLResponse returns an encoder for responses returned by the facebook register-url endpoint.

func Mount

func Mount(mux goahttp.Muxer, h *Server)

Mount configures the mux to serve the facebook endpoints.

func MountAttachToAccountHandler

func MountAttachToAccountHandler(mux goahttp.Muxer, h http.Handler)

MountAttachToAccountHandler configures the mux to serve the "facebook" service "attach-to-account" endpoint.

func MountCORSHandler

func MountCORSHandler(mux goahttp.Muxer, h http.Handler)

MountCORSHandler configures the mux to serve the CORS endpoints for the service facebook.

func MountDetachFromAccountHandler

func MountDetachFromAccountHandler(mux goahttp.Muxer, h http.Handler)

MountDetachFromAccountHandler configures the mux to serve the "facebook" service "detach-from-account" endpoint.

func MountReceiveHandler

func MountReceiveHandler(mux goahttp.Muxer, h http.Handler)

MountReceiveHandler configures the mux to serve the "facebook" service "receive" endpoint.

func MountRegisterURLHandler

func MountRegisterURLHandler(mux goahttp.Muxer, h http.Handler)

MountRegisterURLHandler configures the mux to serve the "facebook" service "register-url" endpoint.

func NewAttachToAccountHandler

func NewAttachToAccountHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewAttachToAccountHandler creates a HTTP handler which loads the HTTP request and calls the "facebook" service "attach-to-account" endpoint.

func NewAttachToAccountPayload

func NewAttachToAccountPayload(authorization *string, xSession *string, aPIKey *string) *facebook.AttachToAccountPayload

NewAttachToAccountPayload builds a facebook service attach-to-account endpoint payload.

func NewCORSHandler

func NewCORSHandler() http.Handler

NewCORSHandler creates a HTTP handler which returns a simple 200 response.

func NewDetachFromAccountHandler

func NewDetachFromAccountHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewDetachFromAccountHandler creates a HTTP handler which loads the HTTP request and calls the "facebook" service "detach-from-account" endpoint.

func NewDetachFromAccountPayload

func NewDetachFromAccountPayload(authorization *string, xSession *string, aPIKey *string) *facebook.DetachFromAccountPayload

NewDetachFromAccountPayload builds a facebook service detach-from-account endpoint payload.

func NewReceiveHandler

func NewReceiveHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewReceiveHandler creates a HTTP handler which loads the HTTP request and calls the "facebook" service "receive" endpoint.

func NewReceivePayload

func NewReceivePayload(code string, state string, authorization *string, xSession *string, redirectURL *string, aPIKey *string) *facebook.ReceivePayload

NewReceivePayload builds a facebook service receive endpoint payload.

func NewRegisterURLHandler

func NewRegisterURLHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewRegisterURLHandler creates a HTTP handler which loads the HTTP request and calls the "facebook" service "register-url" endpoint.

func NewRegisterURLPayload

func NewRegisterURLPayload(aPIKey *string) *facebook.RegisterURLPayload

NewRegisterURLPayload builds a facebook service register-url endpoint payload.

func ReceiveFacebookPath

func ReceiveFacebookPath() string

ReceiveFacebookPath returns the URL path to the facebook service receive HTTP endpoint.

func RegisterURLFacebookPath

func RegisterURLFacebookPath() string

RegisterURLFacebookPath returns the URL path to the facebook service register-url HTTP endpoint.

Types

type AggCampaignMediaResponseBody

type AggCampaignMediaResponseBody struct {
	Rejected    []interface{} `form:"rejected,omitempty" json:"rejected,omitempty" xml:"rejected,omitempty"`
	Invited     []interface{} `form:"invited,omitempty" json:"invited,omitempty" xml:"invited,omitempty"`
	Applied     []interface{} `form:"applied,omitempty" json:"applied,omitempty" xml:"applied,omitempty"`
	Shortlisted []interface{} `form:"shortlisted,omitempty" json:"shortlisted,omitempty" xml:"shortlisted,omitempty"`
	Selected    []interface{} `form:"selected,omitempty" json:"selected,omitempty" xml:"selected,omitempty"`
	Previous    []interface{} `form:"previous,omitempty" json:"previous,omitempty" xml:"previous,omitempty"`
}

AggCampaignMediaResponseBody is used to define fields on response body types.

type AggInstagramMediaResponseBody

type AggInstagramMediaResponseBody struct {
	Website        *string                        `form:"website,omitempty" json:"website,omitempty" xml:"website,omitempty"`
	SelectedPlan   *SelectedPlanMediaResponseBody `form:"selectedPlan,omitempty" json:"selectedPlan,omitempty" xml:"selectedPlan,omitempty"`
	Username       *string                        `form:"username,omitempty" json:"username,omitempty" xml:"username,omitempty"`
	ProfilePicture *string                        `form:"profilePicture,omitempty" json:"profilePicture,omitempty" xml:"profilePicture,omitempty"`
	Bio            *string                        `form:"bio,omitempty" json:"bio,omitempty" xml:"bio,omitempty"`
	ID             *string                        `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	IsBusiness     *bool                          `form:"isBusiness,omitempty" json:"isBusiness,omitempty" xml:"isBusiness,omitempty"`
	FullName       *string                        `form:"fullName,omitempty" json:"fullName,omitempty" xml:"fullName,omitempty"`
}

AggInstagramMediaResponseBody is used to define fields on response body types.

type AggSocialMediaResponseBody

type AggSocialMediaResponseBody struct {
	Instagram *AggInstagramMediaResponseBody `form:"instagram,omitempty" json:"instagram,omitempty" xml:"instagram,omitempty"`
}

AggSocialMediaResponseBody is used to define fields on response body types.

type ErrorNamer

type ErrorNamer interface {
	ErrorName() string
}

ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the design.

type MountPoint

type MountPoint struct {
	// Method is the name of the service method served by the mounted HTTP handler.
	Method string
	// Verb is the HTTP method used to match requests to the mounted handler.
	Verb string
	// Pattern is the HTTP request path pattern used to match requests to the
	// mounted handler.
	Pattern string
}

MountPoint holds information about the mounted endpoints.

type ReceiveResponseBody

type ReceiveResponseBody struct {
	// Unique unchanging user ID
	ID string `form:"id" json:"id" xml:"id"`
	// Phone Number Of the user
	Phone string `form:"phone" json:"phone" xml:"phone"`
	// Family name for the user
	LastName  string  `form:"lastName" json:"lastName" xml:"lastName"`
	UID       *string `form:"uid,omitempty" json:"uid,omitempty" xml:"uid,omitempty"`
	UpdatedAt *string `form:"updatedAt,omitempty" json:"updatedAt,omitempty" xml:"updatedAt,omitempty"`
	// Email attached to the account of the user
	Email string `form:"email" json:"email" xml:"email"`
	// Category of the user generated by our algorithms
	Category     *string                       `form:"category,omitempty" json:"category,omitempty" xml:"category,omitempty"`
	IsActive     *bool                         `form:"isActive,omitempty" json:"isActive,omitempty" xml:"isActive,omitempty"`
	AggCampaigns *AggCampaignMediaResponseBody `form:"aggCampaigns,omitempty" json:"aggCampaigns,omitempty" xml:"aggCampaigns,omitempty"`
	Genres       []string                      `form:"genres,omitempty" json:"genres,omitempty" xml:"genres,omitempty"`
	// Phone Number Of the user
	Username  string                          `form:"username" json:"username" xml:"username"`
	Gender    *string                         `form:"gender,omitempty" json:"gender,omitempty" xml:"gender,omitempty"`
	Onboarded *UserOnboardedMediaResponseBody `form:"onboarded,omitempty" json:"onboarded,omitempty" xml:"onboarded,omitempty"`
	Location  *UserLocationMediaResponseBody  `form:"location,omitempty" json:"location,omitempty" xml:"location,omitempty"`
	Dob       *string                         `form:"dob,omitempty" json:"dob,omitempty" xml:"dob,omitempty"`
	CreatedAt *string                         `form:"createdAt,omitempty" json:"createdAt,omitempty" xml:"createdAt,omitempty"`
	AggSocial *AggSocialMediaResponseBody     `form:"aggSocial,omitempty" json:"aggSocial,omitempty" xml:"aggSocial,omitempty"`
	// Given name for the user
	FirstName          string      `form:"firstName" json:"firstName" xml:"firstName"`
	SocialMediaRawData interface{} `form:"socialMediaRawData,omitempty" json:"socialMediaRawData,omitempty" xml:"socialMediaRawData,omitempty"`
	// 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 `form:"changingEmail,omitempty" json:"changingEmail,omitempty" xml:"changingEmail,omitempty"`
	// Whether the user is an administrator on the site
	IsAdmin bool `form:"isAdmin" json:"isAdmin" xml:"isAdmin"`
	// Whether the user is a brand manager on the site
	IsBrandManager bool `form:"isBrandManager" json:"isBrandManager" xml:"isBrandManager"`
	// Whether the user has verified their email
	VerifiedEmail bool `form:"verifiedEmail" json:"verifiedEmail" xml:"verifiedEmail"`
}

ReceiveResponseBody is the type of the "facebook" service "receive" endpoint HTTP response body.

func NewReceiveResponseBody

func NewReceiveResponseBody(res *facebookviews.UserMediaView) *ReceiveResponseBody

NewReceiveResponseBody builds the HTTP response body from the result of the "receive" endpoint of the "facebook" service.

type SelectedPlanMediaResponseBody

type SelectedPlanMediaResponseBody struct {
	ID          *string `json:"id"`
	Title       *string `json:"title"`
	Description *string `json:"description"`
	CPC         *int    `json:"CPC"`
	Commission  *int    `json:"commission"`
	OneP        *int    `json:"1P"`
	TwoP        *int    `json:"2P"`
	OneV        *int    `json:"1V"`
	TwoV        *int    `json:"2V"`
	OnePOneV    *int    `json:"1P + 1V"`
}

SelectedPlanMediaResponseBody is used to define fields on response body types.

type Server

type Server struct {
	Mounts            []*MountPoint
	RegisterURL       http.Handler
	AttachToAccount   http.Handler
	DetachFromAccount http.Handler
	Receive           http.Handler
	CORS              http.Handler
}

Server lists the facebook service endpoint HTTP handlers.

func New

New instantiates HTTP handlers for all the facebook service endpoints.

func (*Server) Service

func (s *Server) Service() string

Service returns the name of the service served.

func (*Server) Use

func (s *Server) Use(m func(http.Handler) http.Handler)

Use wraps the server handlers with the given middleware.

type UserLocationMediaResponseBody

type UserLocationMediaResponseBody struct {
	Street   *string `form:"street,omitempty" json:"street,omitempty" xml:"street,omitempty"`
	Line2    *string `form:"line2,omitempty" json:"line2,omitempty" xml:"line2,omitempty"`
	Locality *string `form:"locality,omitempty" json:"locality,omitempty" xml:"locality,omitempty"`
	City     *string `form:"city,omitempty" json:"city,omitempty" xml:"city,omitempty"`
	State    *string `form:"state,omitempty" json:"state,omitempty" xml:"state,omitempty"`
	Country  *string `form:"country,omitempty" json:"country,omitempty" xml:"country,omitempty"`
	Postcode *string `form:"postcode,omitempty" json:"postcode,omitempty" xml:"postcode,omitempty"`
	Text     *string `form:"text,omitempty" json:"text,omitempty" xml:"text,omitempty"`
}

UserLocationMediaResponseBody is used to define fields on response body types.

type UserOnboardedMediaResponseBody

type UserOnboardedMediaResponseBody struct {
	Profile         *bool `form:"profile,omitempty" json:"profile,omitempty" xml:"profile,omitempty"`
	Signup          *bool `form:"signup,omitempty" json:"signup,omitempty" xml:"signup,omitempty"`
	Store           *bool `form:"store,omitempty" json:"store,omitempty" xml:"store,omitempty"`
	CampaignDetails *bool `form:"campaignDetails,omitempty" json:"campaignDetails,omitempty" xml:"campaignDetails,omitempty"`
}

UserOnboardedMediaResponseBody is used to define fields on response body types.

Jump to

Keyboard shortcuts

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