deeplinker

package
v0.0.1-alpha5 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEndpoint contains endpoint URL of firebase short link service.
	DefaultEndpoint = "https://firebasedynamiclinks.googleapis.com/v1/shortLinks"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AndroidInfo

type AndroidInfo struct {
	AndroidPackageName string `json:"androidPackageName"`
}

AndroidInfo sets the android package name on the payload.

type DynamicLinkInfo

type DynamicLinkInfo struct {
	DomainURIPrefix string       `json:"domainUriPrefix"`
	Link            *string      `json:"link"`
	AndroidInfo     *AndroidInfo `json:"androidInfo"`
}

DynamicLinkInfo sets the domain uri prefix, the link and the android info on the payload.

type ErrorResponse

type ErrorResponse struct {
	Code    string
	Message string
	Status  string
}

ErrorResponse is the shape of a response in case of a code 400

type FireBaseClient

type FireBaseClient struct {
	Endpoint              string
	APIKey                string
	AndroidPackageName    string
	DomainURIPrefix       string
	ConfirmationEndpoint  string
	ResetPasswordEndpoint string
}

FireBaseClient is interface structure

func NewFireBaseClient

func NewFireBaseClient(config *context.Config) *FireBaseClient

NewFireBaseClient instantiate a new Firebase Client

func (c *FireBaseClient) GetDynamicLink(token string, confirm bool) (string, error)

GetDynamicLink creates a new firebase link

type Payload

type Payload struct {
	DynamicLinkInfo *DynamicLinkInfo `json:"dynamicLinkInfo"`
}

Payload sets the payload.

type Response

type Response struct {
	SuccessResponse *SuccessResponse
	ErrorResponse   *ErrorResponse
}

Response holds the different response types

type SuccessResponse

type SuccessResponse struct {
	Shortlink   string
	Warning     []Warning
	PreviewLink string
}

SuccessResponse is the shape of a response in case of a code 200

type Warning

type Warning struct {
	WarningCode    string
	WarningMessage string
}

Warning is the struct of warning messages

Jump to

Keyboard shortcuts

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