util

package
v0.0.0-...-2df0e36 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AUTH_LOGIN_V3 = BASE_URL_V3 + "/auth/login"

V3 Paths

View Source
var BASE_URL_V1 = "https://api.gotinder.com"
View Source
var BASE_URL_V2 = "https://api.gotinder.com/v2"
View Source
var BASE_URL_V3 = "https://api.gotinder.com/v3"
View Source
var BUCKETS_V2 = BASE_URL_V2 + "/buckets"

V2 Paths

View Source
var Charset = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890")
View Source
var DATA_URL_V3 = "https://data.gotinder.com/v3"
View Source
var GET_UPDATES_V1_URL = BASE_URL_V1 + "/updates?is_boosting=false&boost_cursor=0"
View Source
var KEEPALIVE_SOCKET_URL = "wss://keepalive.gotinder.com/ws"
View Source
var MATCHES_MESSAGES_V2_URL = BASE_URL_V2 + "/matches/%s/messages"
View Source
var MATCHES_V2_URL = BASE_URL_V2 + "/matches"
View Source
var MEDIA_URL_V1 = "https://imageupload.gotinder.com"
View Source
var PROFANITY_FILTER_V1 = STATIC_URL_V1 + "/ays/areyousure_v1.tsv"

Static V1 Paths

View Source
var PROFILE_V2 = BASE_URL_V2 + "/profile?include=offerings%2Cfeature_access%2Cpaywalls%2Caccount%2Cuser%2Cboost%2Ccampaigns%2Ccompliance%2Cemail_settings%2Cexperiences%2Cinstagram%2Clikes%2Conboarding%2Ctravel%2Cplus_control%2Cpurchase%2Creadreceipts%2Cspotify%2Csuper_likes%2Ctinder_u%2Ctop_photo%2Ctutorials%2Conboarding%2Cavailable_descriptors%2Cprofile_meter"
View Source
var SEEN_MATCH_V2_URL = BASE_URL_V2 + "/seen/%s"
View Source
var SEND_MESSAGE_V1_URL = BASE_URL_V1 + "/user/matches/%s"
View Source
var STATIC_URL_V1 = "https://static-assets.gotinder.com"
View Source
var TENOR_SEARCH_V1_URL = BASE_URL_V1 + "/tenor/search"
View Source
var TENOR_TRENDING_V1_URL = BASE_URL_V1 + "/tenor/trending?locale=%s"
View Source
var USER_INFO_V1_URL = BASE_URL_V1 + "/user/%s"

Functions

func DurationMeasure

func DurationMeasure(Type string, Subtype string, Category bin.DurationMeasure_Category, appStart int64) *bin.AppPlatformEvent

Type is oneof: "firstActivityDraw", "firstDraw", "coldStart"

Subtype is oneof: "login" or ""

appStart is the timestamp of when the app was first started, stored in Client

func FormatDateActivity

func FormatDateActivity(t time.Time) string

func HubbleInstrument

func HubbleInstrument(ID string, Type bin.HubbleInstrumentType) *bin.AppPlatformEvent

func NewJsonEvent

func NewJsonEvent(eventName string, app *App, device *Device, extra *JsonEventExtra) (*bin.AppPlatformEvent, error)

func RandStr

func RandStr(length int) string

func RandomHex

func RandomHex(n int) string

func RandomUUIDv4

func RandomUUIDv4() string

Types

type App

type App struct {
	AppVersion             string
	TinderVersion          string
	Platform               string
	PlatformVariant        string
	StoreVariant           string
	Language               string
	UserAgent              string
	XSupportedImageFormats string
	AppStart               int64
	PushEnabled            bool
	LocaleCountry          string
	LastActivityDate       time.Time
}

func (*App) GetFullAppVersion

func (a *App) GetFullAppVersion() string

func (*App) GetFullLocale

func (a *App) GetFullLocale() string

func (*App) GetPlatformNum

func (a *App) GetPlatformNum() int

func (*App) GetSemanticVersions

func (a *App) GetSemanticVersions() SemanticVersions

type BaseEventData

type BaseEventData struct {
	DataProvider          string  `json:"dataProvider,omitempty"`
	AuthID                string  `json:"authId,omitempty"`
	AndroidDeviceID       string  `json:"androidDeviceId,omitempty"`
	PersistentID          string  `json:"persistentId,omitempty"`
	PlatformVariant       string  `json:"platformVariant,omitempty"`
	Model                 string  `json:"model,omitempty"`
	Platform              int     `json:"platform,omitempty"`
	IsDebugBuild          bool    `json:"isDebugBuild"`
	OsVersion             string  `json:"osVersion,omitempty"`
	AppVersion            string  `json:"appVersion,omitempty"`
	InstanceID            string  `json:"instanceId,omitempty"`
	IsPushEnabled         bool    `json:"isPushEnabled,omitempty"`
	Language              string  `json:"language,omitempty"`
	AppSessionTimeElapsed float64 `json:"appSessionTimeElapsed,omitempty"`
	AppBuild              int     `json:"appBuild,omitempty"`
	StoreVariant          string  `json:"storeVariant,omitempty"`
	AppSessionID          string  `json:"appSessionId,omitempty"`
	Manu                  string  `json:"manu,omitempty"`
	Ts                    int64   `json:"ts,omitempty"`
}

func (*BaseEventData) Build

func (data *BaseEventData) Build(app *App, device *Device) map[string]interface{}

type CurrentUser

type CurrentUser struct {
	UserId     string
	Phone      string
	Email      string
	Name       string
	BirthDate  string
	CreateDate string
}

type Device

type Device struct {
	DeviceId           string
	OsVersion          string
	PersistentDeviceId string
	Manufacturer       string
	Model              string
	DeviceOsVersion    string
	DataProvider       string
	AdvertisingId      string
	AuthSession        Session
	Session            Session
	UserSession        UserSession
}

func NewDeviceTemplate

func NewDeviceTemplate() *Device

func (*Device) SaveAsJson

func (d *Device) SaveAsJson(path string) error

type Headers

type Headers struct {
	AppVersion             string `header:"App-Version"`
	ContentType            string `header:"Content-Type"`
	InstallId              string `header:"Install-ID"`
	OsVersion              string `header:"OS-Version"`
	PersistentDeviceId     string `header:"Persistent-Device-ID"`
	Platform               string `header:"Platform"`
	PlatformVariant        string `header:"Platform-Variant"`
	StoreVariant           string `header:"Store-Variant"`
	TinderVersion          string `header:"Tinder-Version"`
	UserAgent              string `header:"User-Agent"`
	XSupportedImageFormats string `header:"X-Supported-Image-Formats"`
	AppSessionId           string `header:"App-Session-Id"`
	AppSessionTimeElapsed  string `header:"App-Session-Time-Elapsed"`
	UserSessionId          string `header:"User-Session-Id"`
	UserSessionTimeElapsed string `header:"User-Session-Time-Elapsed"`
	XAuthToken             string `header:"X-Auth-Token"`
	AdvertisingId          string `header:"Advertising-Id"`
	FunnelSessionId        string `header:"Funnel-Session-Id"`
}

func (*Headers) Build

func (h *Headers) Build(device Device, app *App)

func (*Headers) SetContentType

func (h *Headers) SetContentType(contentType string)

type JsonEventExtra

type JsonEventExtra struct {
	AdvertisingID      string `json:"advertisingId,omitempty"`
	Version            string `json:"version,omitempty"`
	SessionType        string `json:"sessionType,omitempty"`
	SessionStartMethod int    `json:"sessionStartMethod,omitempty"`
	LocaleCountry      string `json:"localeCountry,omitempty"`
	Origin             string `json:"origin,omitempty"`
	Decision           string `json:"decision,omitempty"`
	StepName           string `json:"stepName,omitempty"`
	AuthSessionId      string `json:"authSessionId,omitempty"`
	ActionContext      string `json:"actionContext,omitempty"`
	FunnelSessionId    string `json:"funnelSessionId,omitempty"`
	ActionName         string `json:"actionName,omitempty"`
	FunnelVersion      string `json:"funnelVersion,omitempty"`
	FunnelName         string `json:"funnelName,omitempty"`
}

type JsonEventPayload

type JsonEventPayload struct {
	Schema string                 `json:"schema,omitempty"`
	Event  map[string]interface{} `json:"event,omitempty"`
	Extra  JsonEventExtra         `json:"extra,omitempty"`
}

func (JsonEventPayload) MarshalJSON

func (payload JsonEventPayload) MarshalJSON() ([]byte, error)

type MATCHES_MESSAGES_V2

type MATCHES_MESSAGES_V2 struct{}

func (MATCHES_MESSAGES_V2) BuildUrl

func (m MATCHES_MESSAGES_V2) BuildUrl(matchId string, count string, pageToken *string) string

type MATCHES_V2

type MATCHES_V2 struct{}

func (MATCHES_V2) BuildUrl

func (m MATCHES_V2) BuildUrl(count string, pageToken *string) string

type PreAuthHubbleEvents

type PreAuthHubbleEvents struct {
	LoginFacebookTap              string
	LoginGoogleTap                string
	LoginSMSTap                   string
	SplashImpression              string
	LoginImpression               string
	WelcomeBackImpression         string
	LoginPushTap                  string
	WelcomeBackTextTap            string
	PushAuthDeviceCheckImpression string
	BanImpression                 string
	Default                       string
}

type SEEN_MATCH_V2

type SEEN_MATCH_V2 struct{}

func (SEEN_MATCH_V2) BuildUrl

func (s SEEN_MATCH_V2) BuildUrl(matchId string) string

type SEND_MESSAGE_V1

type SEND_MESSAGE_V1 struct{}

func (SEND_MESSAGE_V1) BuildUrl

func (m SEND_MESSAGE_V1) BuildUrl(matchId string) string

type SemanticVersions

type SemanticVersions struct {
	Major int32
	Minor int32
	Patch int32
}

type Session

type Session struct {
	SessionId   string  `json:"appSessionId" header:"App-Session-Id"`
	TimeElapsed float64 `json:"appSessionTimeElapsed" header:"App-Session-Time-Elapsed"`
	CreatedAt   time.Time
}

func NewSession

func NewSession() Session

func (*Session) Reset

func (s *Session) Reset()

func (*Session) ResetTime

func (s *Session) ResetTime()

func (*Session) TimeElapsedSeconds

func (s *Session) TimeElapsedSeconds() int

func (*Session) TimeElapsedString

func (s *Session) TimeElapsedString() string

func (*Session) UpdateTimeElapsed

func (s *Session) UpdateTimeElapsed()

type TENOR_SEARCH_V1

type TENOR_SEARCH_V1 struct{}

func (TENOR_SEARCH_V1) BuildUrl

func (t TENOR_SEARCH_V1) BuildUrl(query string, locale string) string
type TENOR_TRENDING_V1 struct{}
func (t TENOR_TRENDING_V1) BuildUrl(locale string) string

type Ts

type Ts struct {
	Unix      int64
	UnixMilli int64
}

func GetTimestamp

func GetTimestamp() Ts

type USER_INFO_V1

type USER_INFO_V1 struct{}

func (USER_INFO_V1) BuildUrl

func (u USER_INFO_V1) BuildUrl(userId string) string

type UserSession

type UserSession struct {
	UserId       string
	AuthTokenTTL int64
	RefreshToken string
	XAuthToken   string  `json:"x-auth-token" header:"X-Auth-Token"`
	SessionId    string  `json:"userSessionId" header:"User-Session-Id"`
	TimeElapsed  float64 `json:"userSessionTimeElapsed" header:"User-Session-Time-Elapsed"`
	CreatedAt    time.Time
}

func (*UserSession) Reset

func (s *UserSession) Reset()

func (*UserSession) ResetTime

func (s *UserSession) ResetTime()

func (*UserSession) TimeElapsedString

func (s *UserSession) TimeElapsedString() string

func (*UserSession) UpdateTimeElapsed

func (s *UserSession) UpdateTimeElapsed()

Jump to

Keyboard shortcuts

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