Documentation ¶
Index ¶
- Variables
- func GetTotp(secret string) (string, error)
- type Account
- type BrowserClosed
- type DriverAccount
- func (d *DriverAccount) CreateApi() (*api.TokopediaApi, func(), error)
- func (d *DriverAccount) CreateContext(headless bool) (*DriverContext, func())
- func (driver *DriverAccount) MitraLogin(ctx context.Context) error
- func (d *DriverAccount) Run(headless bool, actionCallback func(dctx *DriverContext) error) error
- func (d *DriverAccount) SaveSession(dctx *DriverContext) error
- func (d *DriverAccount) SellerLogin(dctx *DriverContext) error
- type DriverContext
- type DriverSession
- type Session
- func (sess *Session) AddToHttpRequest(req *http.Request)
- func (sess *Session) DeleteSession() error
- func (sess *Session) GetCookies() []*http.Cookie
- func (sess *Session) Load() error
- func (sess *Session) SaveFromDriver(cookies []*network.Cookie, ua string) error
- func (sess *Session) SaveSession() error
- func (sess *Session) SetCookieToDriver(ctx context.Context) error
- func (sess *Session) Sync() error
- func (sess *Session) Update(cookies []*http.Cookie) error
- func (sess *Session) UserAgent() string
Constants ¶
This section is empty.
Variables ¶
View Source
var BaseSessionPath = "/tokopedia_session_new/"
TODO: cookies dump afternya tidak ada
View Source
var ErrNotSellerAccount = errors.New("not seller account")
View Source
var ErrSellerLoginFailed = errors.New("seller login failed")
View Source
var ErrSessionNotFound = errors.New("session tidak ada")
Functions ¶
Types ¶
type Account ¶
func GetVerificationAkun ¶
type BrowserClosed ¶
type DriverAccount ¶
type DriverAccount struct { Username string `json:"username"` Password string `json:"password"` Secret string `json:"secret"` DevMode bool `json:"-"` Proxy string `json:"-"` Session DriverSession `json:"-"` ParentCtx context.Context `json:"-"` }
func NewDriverAccount ¶
func NewDriverAccount(username string, password string, secret string) (*DriverAccount, error)
func (*DriverAccount) CreateApi ¶
func (d *DriverAccount) CreateApi() (*api.TokopediaApi, func(), error)
func (*DriverAccount) CreateContext ¶
func (d *DriverAccount) CreateContext(headless bool) (*DriverContext, func())
func (*DriverAccount) MitraLogin ¶
func (driver *DriverAccount) MitraLogin(ctx context.Context) error
func (*DriverAccount) Run ¶
func (d *DriverAccount) Run(headless bool, actionCallback func(dctx *DriverContext) error) error
func (*DriverAccount) SaveSession ¶ added in v1.0.1
func (d *DriverAccount) SaveSession(dctx *DriverContext) error
func (*DriverAccount) SellerLogin ¶
func (d *DriverAccount) SellerLogin(dctx *DriverContext) error
type DriverSession ¶
type DriverSession interface { SetCookieToDriver(ctx context.Context) error Load() error DeleteSession() error SaveSession() error Sync() error Update(cookies []*http.Cookie) error AddToHttpRequest(req *http.Request) UserAgent() string SaveFromDriver(cookies []*network.Cookie, ua string) error GetCookies() []*http.Cookie }
type Session ¶
type Session struct { sync.Mutex Cookies []*http.Cookie Ua string // contains filtered or unexported fields }
func NewSession ¶
func (*Session) AddToHttpRequest ¶
func (*Session) DeleteSession ¶
func (*Session) GetCookies ¶
func (*Session) SaveFromDriver ¶
func (*Session) SaveSession ¶
func (*Session) SetCookieToDriver ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.