api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeMap = map[int]FieldTypeConfig{
	0: {
		Name:                             "String",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
	1: {
		Name:                             "CheckBox",
		ShouldDisplayValidaitonRuleInput: false,
		ShouldShowOption:                 false,
	},
	2: {
		Name:                             "Option",
		ShouldDisplayValidaitonRuleInput: false,
		ShouldShowOption:                 true,
	},
	3: {
		Name:                             "Password",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
	4: {
		Name:                             "Hidden",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
	5: {
		Name:                             "Email",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
	6: {
		Name:                             "Text",
		ShouldDisplayValidaitonRuleInput: true,
		ShouldShowOption:                 false,
	},
}

Functions

func CheckHookID added in v0.3.0

func CheckHookID(hookid string) (bool, error)

func CheckPlan added in v0.3.3

func CheckPlan() error

func CurrentID added in v0.3.0

func CurrentID() (int64, error)

func GetAppsInfo added in v0.3.0

func GetAppsInfo() (map[int64]SitesReponse, error)

func ResetSecret added in v0.3.0

func ResetSecret() error

func SitesBasic added in v0.3.0

func SitesBasic(tokens *SitesToken) error

func UpdateDomain added in v0.3.0

func UpdateDomain(domains []string) error

Types

type AccountPayment added in v0.3.0

type AccountPayment struct {
	Data struct {
		Order []struct {
			Totalamount         int         `json:"TotalAmount"`
			Recurringprofileid  interface{} `json:"RecurringProfileId"`
			Basediscount        int         `json:"BaseDiscount"`
			Promotionaldiscount int         `json:"PromotionalDiscount"`
			Initialamount       int         `json:"InitialAmount"`
			Tax                 int         `json:"Tax"`
			UUID                interface{} `json:"Uuid"`
			Invoiceno           int         `json:"InvoiceNo"`
			Createddate         time.Time   `json:"CreatedDate"`
			Lastmodifieddate    time.Time   `json:"LastModifiedDate"`
			Isactive            bool        `json:"IsActive"`
			Isdeleted           bool        `json:"IsDeleted"`
			Orderid             int         `json:"OrderId"`
			Paymentdetail       struct {
				Stripecustomerid      string `json:"StripeCustomerId"`
				Stripepaymentmethodid string `json:"StripePaymentMethodId"`
			} `json:"PaymentDetail"`
			Orderdetails []interface{} `json:"OrderDetails"`
		} `json:"Order"`
		Carddetails struct {
			Expmonth int    `json:"expMonth"`
			Expyear  int    `json:"expYear"`
			Last4    string `json:"last4"`
		} `json:"cardDetails"`
	} `json:"data"`
	Sharedsiteownerdata interface{} `json:"sharedSiteOwnerData"`
}

func PaymentInfo added in v0.3.0

func PaymentInfo() (*AccountPayment, error)

type CoreAppData added in v0.3.0

type CoreAppData struct {
	Apps struct {
		Data []SitesReponse `json:"Data"`
	} `json:"apps"`
}

type FieldTypeConfig added in v0.3.0

type FieldTypeConfig struct {
	Name                             string
	ShouldDisplayValidaitonRuleInput bool
	ShouldShowOption                 bool
}

type HooksResponse added in v0.3.0

type HooksResponse struct {
	Data []struct {
		ID               string    `json:"Id"`
		Appid            int       `json:"AppId"`
		Createddate      time.Time `json:"CreatedDate"`
		Lastmodifieddate time.Time `json:"LastModifiedDate"`
		Targeturl        string    `json:"TargetUrl"`
		Event            string    `json:"Event"`
		Name             string    `json:"Name"`
	} `json:"Data"`
}

func Hooks added in v0.3.0

func Hooks(method string, body string) (*HooksResponse, error)

type HostedPageResponse

type HostedPageResponse struct {
	Pages []struct {
		Pagetype     string        `json:"PageType"`
		Customcss    []string      `json:"CustomCss"`
		Headtags     []interface{} `json:"HeadTags"`
		Favicon      string        `json:"FavIcon"`
		Htmlbody     string        `json:"HtmlBody"`
		Endscript    string        `json:"EndScript"`
		Beforescript string        `json:"BeforeScript"`
		Customjs     []string      `json:"CustomJS"`
		Isactive     bool          `json:"IsActive"`
		Mainscript   string        `json:"MainScript"`
		Commonscript string        `json:"CommonScript"`
		Status       string        `json:"Status"`
	} `json:"Pages"`
}

func GetPage

func GetPage() (*HostedPageResponse, error)

type LoginOpts added in v0.3.1

type LoginOpts struct {
	AccessToken string `schema:"token" json:"accesstoken"`
	AppName     string `schema:"appName"`
	Domain      string `schema:"domain" json:"domain"`
	DataCenter  string `schema:"dataCenter" json:"dataCenter"`
	Plan        string `schema:"plan" json:"plan"`
	Role        string `schema:"role" json:"role"`
	LookingFor  string `schema:"lookingFor" json:"lookingFor"`
}

type LoginResponse

type LoginResponse struct {
	APIVersion    string      `json:"api_Version"`
	AppID         int64       `json:"app_id"`
	AppName       string      `json:"app_name"`
	Authenticated bool        `json:"authenticated"`
	NoOfLogins    int32       `json:"no_of_logins"`
	PlanDetails   interface{} `json"plan_detail"`
	XSign         string      `json:"xsign"`
	XToken        string      `json:"xtoken"`
}

func AuthLogin

func AuthLogin(params LoginOpts) (*LoginResponse, error)

type OptSchema added in v0.4.0

type OptSchema struct {
	Value string `json:"value"`
	Text  string `json:"text"`
}

type Provider added in v0.3.2

type Provider struct {
	HtmlFileName   string   `json:"HtmlFileName"`
	Provider       string   `json:"Provider"`
	ProviderId     int      `json:"ProviderId"`
	ProviderKey    string   `json:"ProviderKey"`
	ProviderSecret string   `json:"ProviderSecret"`
	Scope          []string `json:"Scope"`
	Status         bool     `json:"Status"`
}

type ProviderList added in v0.3.2

type ProviderList struct {
	Data []Provider `json:"Data"`
}

func GetActiveProviders added in v0.3.2

func GetActiveProviders() (*ProviderList, error)

type ResetResponse added in v0.3.0

type ResetResponse struct {
	Secret string `json:"Secret"`
	XSign  string `json:"xsign"`
	XToken string `json:"xtoken"`
}

type Schema added in v0.3.0

type Schema struct {
	Display          string      `json:"Display"`
	Enabled          bool        `json:"Enabled"`
	IsMandatory      bool        `json:"IsMandatory"`
	Parent           string      `json:"Parent"`
	ParentDataSource string      `json:"ParentDataSource"`
	Permission       string      `json:"Permission"`
	Name             string      `json:"name"`
	Options          []OptSchema `json:"options"`
	Rules            string      `json:"rules"`
	Status           string      `json:"status"`
	Type             string      `json:"type"`
}

type SitesReponse

type SitesReponse struct {
	Appname               string      `json:"AppName"`
	Customername          *string     `json:"CustomerName"`
	Webtechnology         int         `json:"WebTechnology"`
	Domain                string      `json:"Domain"`
	Callbackurl           string      `json:"CallbackUrl"`
	Devdomain             string      `json:"DevDomain"`
	Ismobile              bool        `json:"IsMobile"`
	Appid                 int64       `json:"AppId"`
	Key                   string      `json:"Key"`
	Secret                string      `json:"Secret"`
	Role                  string      `json:"Role"`
	Iswelcomeemailenabled bool        `json:"IsWelcomeEmailEnabled"`
	Ishttps               bool        `json:"Ishttps"`
	Interfaceid           int         `json:"InterfaceId"`
	Recurlyaccountcode    *string     `json:"RecurlyAccountCode"`
	Userlimit             int         `json:"UserLimit"`
	Domainlimit           int         `json:"DomainLimit"`
	Datecreated           time.Time   `json:"DateCreated"`
	Datemodified          time.Time   `json:"DateModified"`
	Status                bool        `json:"Status"`
	Profilephoto          *string     `json:"ProfilePhoto"`
	Apiversion            string      `json:"ApiVersion"`
	Israasenabled         bool        `json:"IsRaasEnabled"`
	Privacypolicy         interface{} `json:"PrivacyPolicy"`
	Termsofservice        interface{} `json:"TermsOfService"`
	Ownerid               string      `json:"OwnerId"`
	Productplan           *struct {
		Name         string      `json:"Name"`
		Expirytime   time.Time   `json:"ExpiryTime"`
		Billingcycle interface{} `json:"BillingCycle"`
		Fromdate     interface{} `json:"FromDate"`
	} `json:"ProductPlan"`
}

func GetSites

func GetSites() (*SitesReponse, error)

type SitesToken added in v0.3.0

type SitesToken struct {
	APIVersion    string `json:"ApiVersion"`
	AppID         int64  `json:"AppId"`
	AppName       string `json:"AppName"`
	Authenticated bool   `json:"authenticated"`
	XSign         string `json:"xsign"`
	XToken        string `json:"xtoken"`
}

func SetSites added in v0.3.0

func SetSites(appid int64) (*SitesToken, error)

type StandardFields added in v0.4.0

type StandardFields struct {
	Data []Schema `json:"Data"`
}

func GetStandardFields added in v0.4.0

func GetStandardFields(ftype string) (*StandardFields, error)

type ValidateTokenResp

type ValidateTokenResp struct {
	AccessToken  string    `json:"access_token"`
	ExpiresIn    time.Time `json:"expires_in"`
	RefreshToken string    `json:"refresh_token"`
}

func AuthValidateToken

func AuthValidateToken() (*ValidateTokenResp, error)

Jump to

Keyboard shortcuts

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