tp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLoginInfo

func GetLoginInfo(cookies *Cookies, config Config) (user string)

func Requests

func Requests(method string, config Config, isPostBelanja bool, body io.Reader, cookies *Cookies) (respBody []byte)

func UpdateCookies

func UpdateCookies(email string, config Config) string

Types

type Config

type Config struct {
	URL       string
	UserAgent string
	RTO       int
	Host      string
	Origin    string
	Referer   string
	MongoConn *mongo.Database
}

type Cookies

type Cookies struct {
	Cookiesession1   http.Cookie `json:"cookiesession1,omitempty" bson:"cookiesession1,omitempty"`
	Potp_session     http.Cookie `json:"potp_session,omitempty" bson:"potp_session,omitempty"`
	Csrf_cookie_name http.Cookie `json:"csrf_cookie_name,omitempty" bson:"csrf_cookie_name,omitempty"`
}

func SetCookies

func SetCookies(user UserSession) (usercookies Cookies)

type UserCookies

type UserCookies struct {
	Username string      `json:"username,omitempty" url:"username,omitempty"`
	Password string      `json:"password,omitempty" url:"password,omitempty"`
	Cookies  interface{} `json:"cookies,omitempty" url:"cookies,omitempty"`
}

type UserCred

type UserCred struct {
	Username string      `json:"username,omitempty" url:"username,omitempty"`
	Password string      `json:"password,omitempty" url:"password,omitempty"`
	Nama     string      `json:"nama,omitempty" url:"nama,omitempty"`
	Session  UserSession `json:"session,omitempty" url:"session,omitempty"`
}

type UserSession

type UserSession struct {
	Cookiesession1   string `json:"cookiesession1,omitempty" url:"cookiesession1,omitempty"`
	Potp_session     string `json:"potp_session,omitempty" url:"potp_session,omitempty"`
	Csrf_cookie_name string `json:"csrf_cookie_name,omitempty" url:"csrf_cookie_name,omitempty"`
}

Jump to

Keyboard shortcuts

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