abelana

package
v0.0.0-...-f48b261 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2016 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package abelana is a set of utilities to validate our GitKit and Access Tokens. For now, we are providing our own Access Tokens, later, we will use GitKit's tokens when they become available.

Index

Constants

This section is empty.

Variables

View Source
var DEBUG = true

Functions

func Aauth

Aauth validates a given AccessToken

func FProfile

func FProfile(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

FProfile - Get a specific followers entries only (TlfReq) : TlResp

func Flag

Flag will bring this to the administrators attention.

func Follow

Follow will see if we can follow the user, given their email

func FollowByID

func FollowByID(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

FollowByID - will tell us about a new possible follower (FrReq) : Status

func GetFollowing

func GetFollowing(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

GetFollowing - A list of those I follow (AToken) :

func GetMyProfile

func GetMyProfile(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

GetMyProfile - Get my entries only (token) : TlResp

func GetPerson

func GetPerson(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

GetPerson -- find out about someone : Person

func GetPhotoComments

func GetPhotoComments(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

GetPhotoComments will get the comments given a photoid

func GetSecretKey

func GetSecretKey(w http.ResponseWriter)

GetSecretKey will send our key in a way that we should only be called once.

func GetTimeLine

func GetTimeLine(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

GetTimeLine - get the timeline for the user (token) : TlResp

func Import

Import for Facebook / G+ / ... (xcred) : StatusResp

func Like

Like let's the user tell of their joy (Photo) : Status

func Login

Login - see if the token is valid

func PostPhoto

PostPhoto lets us know that we have a photo, we then tell both DataStore and Redis What is sent is just the id, either uuuuu.rrrrr or uuuuu where u=userID, and rrrrr is random photoID

func Refresh

Refresh will refresh an Access Token (ATok)

func Register

func Register(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

Register will start GCM messages to your device (GCMReq) : Status

func SetPhotoComments

func SetPhotoComments(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

SetPhotoComments allows the users voice to be heard (PhotoComment) : Status

func Statistics

func Statistics(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

Statistics will tell you about a user

func Unlike

Unlike let's the user recind their +1 (Photo) : Status

func Unregister

func Unregister(cx appengine.Context, at Access, p martini.Params, w http.ResponseWriter)

Unregister will stop GCM messages from going to your device (GCMReq) : Status

func Wipeout

Wipeout will erase all data you are working on. (Atok) : Status

Types

type ATOKJson

type ATOKJson struct {
	Kind string `json:"kind"`
	Atok string `json:"atok"`
}

ATOKJson is the json message for an Access Token (TEMPORARY - Until GitKit supports this)

type AbelanaConfig

type AbelanaConfig struct {
	AuthEmail         string
	ProjectID         string
	Bucket            string
	RedisPW           string
	Redis             string
	ServerKey         string
	AutoFollowers     []string
	Silhouette        string
	TimelineBatchSize int
	UploadRetries     int
	EnableBackdoor    bool
}

AbelanaConfig contains all the information we need to run Abelana

type AccToken

type AccToken struct {
	UserID string
	Iat    int64
	Exp    int64
}

AccToken is what we pass to our client, would rather not have the password here as it will go away when Idenitty Toolkit supports access tokens.

func (*AccToken) Expired

func (at *AccToken) Expired() bool

Expired tells us if we have a valid AuthToken

func (*AccToken) ID

func (at *AccToken) ID() string

ID accessor func for UserID

type Access

type Access interface {
	Expired() bool
	ID() string
}

Access lets us know if we need another

type Comment

type Comment struct {
	PersonID string `json:"personid"`
	Text     string `json:"text"`
	Time     int64  `json:"time"`
}

Comment holds all comments

type Comments

type Comments struct {
	Kind    string    `json:"kind"`
	Entries []Comment `json:"entries"`
}

Comments returned from GetComments()

type Person

type Person struct {
	Kind     string `json:"kind,omitempty"`
	PersonID string `json:"personid"`
	Email    string `json:"email,omitempty"`
	Name     string `json:"name"`
}

Person holds information about our followers

type Persons

type Persons struct {
	Kind    string   `json:"kind"`
	Persons []Person `json:"persons"`
}

Persons holds a list of our followers

type Photo

type Photo struct {
	PhotoID string
	Date    int64
}

Photo is how we keep images in Datastore

type Stats

type Stats struct {
	Following int `json:"following"`
	Followers int `json:"followers"`
}

Stats contains useful user statistics

type Status

type Status struct {
	Kind   string `json:"kind"`
	Status string `json:"status"`
}

Status is what we return if we have nothing to return

type TLEntry

type TLEntry struct {
	Created int64  `json:"created"`
	UserID  string `json:"userid"`
	Name    string `json:"name"`
	PhotoID string `json:"photoid"`
	Likes   int    `json:"likes"`
	ILike   bool   `json:"ilike"`
}

TLEntry holds timeline entries

type Timeline

type Timeline struct {
	Kind    string    `json:"kind"`
	Entries []TLEntry `json:"entries"`
}

Timeline the data the client sees.

type ToLike

type ToLike struct {
	UserID string
}

ToLike knows about who likes you.

type User

type User struct {
	UserID        string
	DisplayName   string
	Email         string
	FollowsMe     []string // list of userID's
	IFollow       []string
	IWantToFollow []string // list of email addresses
}

User is the root structure for everything.

Jump to

Keyboard shortcuts

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