api

package
v0.0.0-...-101454b Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: Apache-2.0 Imports: 19 Imported by: 15

Documentation

Index

Constants

View Source
const (
	DELETE = "DELETE"
	POST   = "POST"
	GET    = "GET"
	UPDATE = "UPDATE"
)
View Source
const (
	HOST              = "url"
	PATH              = "path"
	EMAIL             = "email"
	PASSWORD          = "password"
	MASTER_KEY        = "master_key"
	API_KEY           = "api_key"
	ORG_ID            = "org_id"
	X_Megam_EMAIL     = "X-Megam-EMAIL"
	X_Megam_MASTERKEY = "X-Megam-MASTERKEY"
	X_Megam_PUTTUSAVI = "X-Megam-PUTTUSAVI"
	X_Megam_DATE      = "X-Megam-DATE"
	X_Megam_HMAC      = "X-Megam-HMAC"
	X_Megam_OTTAI     = "X-Megam-OTTAI"
	X_Megam_ORG       = "X-Megam-ORG"
	Content_Type      = "Content-Type"
	Accept            = "Accept"
)
View Source
const (
	REQUEST_CREATE = "/requests/content"
)

Variables

This section is empty.

Functions

func CalcBase64

func CalcBase64(data string) string

func CalcHMAC

func CalcHMAC(secret string, message string) string

func GetMD5Hash

func GetMD5Hash(text []byte) string

func GetPort

func GetPort() string

Types

type ApiArgs

type ApiArgs struct {
	Email      string
	Api_Key    string
	Master_Key string
	Password   string
	Org_Id     string
	Url        string
	Path       string
}

func NewArgs

func NewArgs(args map[string]string) ApiArgs

func (ApiArgs) ToMap

func (c ApiArgs) ToMap() map[string]string

type Authly

type Authly struct {
	UrlSuffix string
	Date      string
	JSONBody  []byte
	Keys      map[string]string
	AuthMap   map[string]string
}

func NewAuthly

func NewAuthly(c VerticeApi) *Authly

func (*Authly) AuthHeader

func (authly *Authly) AuthHeader() error

func (*Authly) GetURL

func (auth *Authly) GetURL() string

type Client

type Client struct {
	HTTPClient *http.Client

	Authly *Authly
	Url    string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(c VerticeApi, path string) *Client

func (*Client) Delete

func (c *Client) Delete() ([]byte, error)

func (*Client) Do

func (c *Client) Do(request *http.Request) (*http.Response, error)

func (*Client) Get

func (c *Client) Get() ([]byte, error)

func (*Client) Post

func (c *Client) Post(data interface{}) ([]byte, error)

type Context

type Context struct {
}

type Requests

type Requests struct {
	Name      string `json:"name" cql:"name"`
	AccountId string `json:"account_id" cql:"account_id"`
	CatId     string `json:"cat_id" cql:"cat_id"`
	Action    string `json:"action" cql:"action"`
	Category  string `json:"category" cql:"category"`
	CatType   string `json:"cattype" cql:"cattype"`
}

func NewRequest

func NewRequest(email string) *Requests

func (*Requests) PushRequest

func (r *Requests) PushRequest(mi map[string]string) error

func (*Requests) String

func (r *Requests) String() string

type VerticeApi

type VerticeApi interface {
	ToMap() map[string]string
}

Jump to

Keyboard shortcuts

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