authcontext

package
v0.0.0-...-cfce1d4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthUser

type AuthUser struct {
	Name  string
	Email string
}

AuthUser defines user attributes

type Context

type Context struct {
	AppEngineCtx    context.Context
	DataStoreClient PersistenceClient
	GinCtx          *gin.Context
	AuthUser        AuthUser
}

Context holds all the necessary data

func NewAuthContext

func NewAuthContext(c *gin.Context) (*Context, error)

NewAuthContext creates a new context with required data

type PersistenceClient

type PersistenceClient interface {
	AllocateIDs(ctx context.Context, keys []*datastore.Key) ([]*datastore.Key, error)
	Count(ctx context.Context, q *datastore.Query) (n int, err error)
	Delete(ctx context.Context, key *datastore.Key) error
	Get(ctx context.Context, key *datastore.Key, dst interface{}) (err error)
	GetAll(ctx context.Context, q *datastore.Query, dst interface{}) (keys []*datastore.Key, err error)
	NewTransaction(ctx context.Context, opts ...datastore.TransactionOption) (t *datastore.Transaction, err error)
	Put(ctx context.Context, key *datastore.Key, src interface{}) (*datastore.Key, error)
}

PersistenceClient A wrapper aound the datastore client

Jump to

Keyboard shortcuts

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