Documentation ¶
Index ¶
- Constants
- func ConvertValuesToMap(params url.Values) map[string]string
- func CreateGetRequest(endpoint, auth_token string, params url.Values) (*http.Request, error)
- func CreateMediaId(username string) string
- func CreatePostRequest(endpoint string, auth_token string, params url.Values) (*http.Request, error)
- func CreateRequestToken(token, timestamp string) string
- func DecodeBase64(s string) []byte
- func Decrypt(ciphertext []byte) []byte
- func DecryptStory(data []byte, key, iv string) []byte
- func EncodeBase64(b []byte) string
- func Encrypt(data []byte) []byte
- func GetBlob(snap_id string, user User) []byte
- func GetStory(story_id, auth_token, media_key, media_iv string) []byte
- func GetTimestamp() string
- func IsImage(data []byte) bool
- func IsOverlay(data []byte) bool
- func IsVideo(data []byte) bool
- func IsZip(data []byte) bool
- func Logout(username, auth_token string) bool
- func MakeGetRequest(endpoint string, auth_token string, params url.Values) (*http.Response, error)
- func MakeRequest(endpoint string, auth_token string, params url.Values) (*http.Response, error)
- func PKCS5Pad(data []byte) []byte
- func PanicIfErr(err error)
- func Unzip(data []byte) [][]byte
- type Friend
- type FriendStory
- type FriendStoryDict
- type LoginResponse
- type Snap
- type StoryContent
- type StoryResponse
- type User
Constants ¶
View Source
const ( //various constants URL string = "https://feelinsonice-hrd.appspot.com" SECRET string = "iEk21fuwZApXlz93750dmW22pw389dPwOk" STATIC_TOKEN string = "m198sOkJEn37DjqZ32lpRu76xmw288xSQ9" BLOB_ENCRYPTION_KEY string = "M02cnQ51Ji97vwT4" PATTERN string = "0001110111101110001111010101111011010001001110011000110001000110" //media types IMAGE = 0 VIDEO = 1 VIDEO_NOAUDIO = 2 FRIEND_REQUEST = 3 FRIEND_REQUEST_IMAGE = 4 FRIEND_REQUEST_VIDEO = 5 FRIEND_REQUEST_VIDEO_NOAUDIO = 6 //media states NONE = -1 SENT = 0 DELIVERED = 1 VIEWED = 2 SCREENSHOT = 3 )
Variables ¶
This section is empty.
Functions ¶
func CreateGetRequest ¶
func CreateMediaId ¶
leaving this out for now, as it depended on an external lib, and I'm not using it yet
func CreatePostRequest ¶
func CreateRequestToken ¶
func DecodeBase64 ¶
func DecryptStory ¶
func EncodeBase64 ¶
func GetTimestamp ¶
func GetTimestamp() string
func MakeGetRequest ¶
func MakeRequest ¶
func PanicIfErr ¶
func PanicIfErr(err error)
func Unzip ¶
some snap data is zipped up, which makes it hard to get at the solution is to save the data to disk, and then read it in with a zip reader, and then return the byte values for each thing in the zip usually there is an overlay (image) and contents(image or video) Note: zipped data is cleaned up after returning
Types ¶
type FriendStory ¶
type FriendStory struct { Viewed bool `json:"viewed"` Stories StoryContent `json:"story"` }
individual story object
type FriendStoryDict ¶
type FriendStoryDict struct { Username string `json:"username"` FriendStories []FriendStory `json:"stories"` }
User mapped to a list of that users available stories
type LoginResponse ¶
type LoginResponse struct { Bests []string `json:"bests"` Score int `json:"score"` Snaps []Snap `json:"snaps"` Friends []Friend `json:"friends"` AuthToken string `json:"auth_token"` Username string `json:"username"` }
//////////////////////////////// Login Structs ////////////////////////////////
func GetUpdates ¶
func GetUpdates(username, auth_token string) LoginResponse
similar to a login, but does not authenticate simply retreives the snap response
func Login ¶
func Login(username, password string) LoginResponse
type Snap ¶
type Snap struct { SnapId string `json:"id"` ScreenName string `json:"sn"` RecipientName string `json:"rp"` MediaType int `json:"m"` MediaState int `json:"st"` Unopened uint64 `json:"t,omitempty"` }
func (Snap) IsIncoming ¶
func (Snap) IsUnopened ¶
type StoryContent ¶
type StoryContent struct { Id string `json:"id"` Username string `json:"username"` MediaId string `json:"media_id"` MediaKey string `json:"media_key"` MediaIv string `json:"media_iv"` ThumbnailIv string `json:"thumbnail_iv"` MediaType int `json:"media_type"` MediaUrl string `json:"media_url"` ThumbnailUrl string `json:"thumbnail_url"` }
inner content for a story
type StoryResponse ¶
type StoryResponse struct {
Friends []FriendStoryDict `json:"friend_stories"`
}
func GetStories ¶
func GetStories(username, auth_token string) StoryResponse
Click to show internal directories.
Click to hide internal directories.