identity

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(
	ctx context.Context, u url.URL, appID, deviceID uuid.UUID, log logger.Logger,
) (t speechly.AccessToken, err error)

GetAccessToken is a convenience wrapper that instantiates a new identity client and calls Login on it.

Types

type Client

type Client struct {
	*pgrpc.Client
}

Client is a client for Speechly Identity API.

func NewClient

func NewClient(u url.URL) (*Client, error)

NewClient returns a new Client configured to use provided URL.

func (*Client) Login

func (c *Client) Login(ctx context.Context, appID, deviceID uuid.UUID) (t speechly.AccessToken, err error)

Login calls Identity.Login method with provided identifiers and within provided context. It will parse returned token into speechly.AccessToken and return it or any error if it happens. nolint: interfacer // linter wants to pass a Stringer instead of UUID, which defeats the purpose of type safety.

Jump to

Keyboard shortcuts

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