dynamodb

package
v0.0.0-...-977d26f Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDBService

type DynamoDBService struct {
	*dynamodb.DynamoDB
}

DynamoDBService provides methods to use DynamoDB via the AWS SDK

func NewDynamoDBService

func NewDynamoDBService() *DynamoDBService

NewDynamoDBService creates a new DynamoDBService by loading AWS credentials from ~/.aws/credentials and AWS region from ~/.aws/config

func (*DynamoDBService) GetUser

func (db *DynamoDBService) GetUser(userID string) (*User, error)

GetUser returns a user from DynamoDB

func (*DynamoDBService) PutUser

func (db *DynamoDBService) PutUser(user *User) error

PutUser creates and updates a new user in DynamoDB

type User

type User struct {
	UserID       string
	AccessToken  string
	RefreshToken string
	Expiry       time.Time
	TokenType    string
}

User represents the broadcaster and their API credentials in DynamoDB

Jump to

Keyboard shortcuts

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