provider

package
v0.0.0-...-a7a3968 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidProvider is used when the provider is invalid
	ErrInvalidProvider = errors.New("invalid provider selected, please choose a valid provider")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	GetID() string
	GetSecret() string
}

Client holds the basic methods for a client

type HelloFresh

type HelloFresh struct {
	// contains filtered or unexported fields
}

HelloFresh represents a provider

func NewHelloFresh

func NewHelloFresh(url string) *HelloFresh

NewHelloFresh creates a new instance of HelloFresh

func (*HelloFresh) Create

func (p *HelloFresh) Create(name string, redirectURI string) (Client, error)

Create a client

func (*HelloFresh) Remove

func (p *HelloFresh) Remove(id string) error

Remove a client

type HelloFreshClient

type HelloFreshClient struct {
	ID          uuid.UUID `json:"id"`
	Secret      string    `json:"secret"`
	Extra       string    `json:"extra"`
	RedirectURI string    `json:"redirect_uri"`
}

HelloFreshClient represents the hellofresh client

func (*HelloFreshClient) GetID

func (c *HelloFreshClient) GetID() string

GetID retrieves the client's ID

func (*HelloFreshClient) GetSecret

func (c *HelloFreshClient) GetSecret() string

GetSecret retrieves the client's secret

type Provider

type Provider interface {
	Create(name string, redirectURI string) (Client, error)
	Remove(id string) error
}

Provider holds the basic methods for a provider

func Create

func Create(name string, providerURL string) (Provider, error)

Create the correct provider for a given name

Jump to

Keyboard shortcuts

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