Documentation ¶
Index ¶
- Constants
- func GeContentTypeStr(value ContentType) string
- func GetMethodStr(value TMethod) string
- func NewAuth2() *auth2
- func NewProxy() *proxy
- type AuthorizationType
- type ClientAuth
- type Content
- type ContentBinary
- type ContentFile
- type ContentFormField
- type ContentText
- type ContentType
- type EncType
- type Fields
- type Header
- type IWebsocket
- type ListContentBinary
- type ListContentFile
- type ListContentFormField
- type ListContentText
- type Params
- type Request
- func (H *Request) AddContentBin(name string, filename string, value []byte)
- func (H *Request) AddContentText(Name string, value *ST.Strings)
- func (H *Request) AddFormField(fieldName string, fieldValue string)
- func (H *Request) AddSubmitFile(key string, filename string, contentType string, content []byte)
- type Response
- type Status
- type TCert
- type THttp
- func (H *THttp) Conectar() error
- func (H *THttp) Desconectar() error
- func (H *THttp) EnviarBinario(messageType int, data []byte) error
- func (H *THttp) EnviarBinarioTypeBinaryMessage(data []byte) error
- func (H *THttp) EnviarTextTypeTextMessage(data []byte) error
- func (H *THttp) EnviarTexto(messageType int, data string) error
- func (H *THttp) GetAuthorizationType() AuthorizationType
- func (H *THttp) GetFullURL() (string, error)
- func (H *THttp) GetMetodo() TMethod
- func (H *THttp) GetMetodoStr() string
- func (H *THttp) GetUrl() string
- func (H *THttp) IsConect() bool
- func (H *THttp) Send() (*Response, error)
- func (H *THttp) SetAuthorizationType(value AuthorizationType) error
- func (H *THttp) SetMetodo(value TMethod) error
- func (H *THttp) SetMetodoStr(value string) error
- func (H *THttp) SetUrl(value string) error
- type TMethod
- type TokenResponse
- type Varibles
- func (v *Varibles) Add(key string, value string)
- func (v *Varibles) Clear()
- func (v *Varibles) Count() int
- func (v *Varibles) Del(key string)
- func (v *Varibles) Exist(key string) bool
- func (v *Varibles) Get(key string) string
- func (v *Varibles) Keys() []string
- func (v *Varibles) Set(key string, value string)
- func (v *Varibles) ToMap() map[string]string
- func (v *Varibles) Values() []string
- type WebSocket
- type Writer
- func (w *Writer) Boundary() string
- func (w *Writer) Close() error
- func (w *Writer) CreateFormField(fieldname string) (io.Writer, error)
- func (w *Writer) CreateFormFile(fieldname string, filename string) (io.Writer, error)
- func (w *Writer) CreateFormFile2(fieldname string, filename string, contenttype string) (io.Writer, error)
- func (w *Writer) CreatePart(header textproto.MIMEHeader) (io.Writer, error)
- func (w *Writer) FormDataContentType() string
- func (w *Writer) SetBoundary(boundary string) error
- func (w *Writer) WriteField(fieldname, value string) error
Constants ¶
const ( MSG_DISCONECT = "Perca de Conexão..." MSG_RECONECTANDO = "Reconectando..." MSG_RECONECTADO = "Reconectado..." MSG_CONECTADO = "Conectado..." )
Variables ¶
This section is empty.
Functions ¶
func GeContentTypeStr ¶
func GeContentTypeStr(value ContentType) string
func GetMethodStr ¶
Types ¶
type AuthorizationType ¶
type AuthorizationType int
const ( AT_AutoDetect AuthorizationType = iota AT_Basic AT_Bearer AT_Auth2 AT_Nenhum )
type ClientAuth ¶
type ClientAuth int
const ( CA_SendBasicAuthHeader ClientAuth = iota CA_SendClientCredentialsInBody )
type ContentBinary ¶
type ContentFile ¶
type ContentFormField ¶
type ContentText ¶
type ContentType ¶
type ContentType int
const ( CT_NONE ContentType = 0 CT_TEXT ContentType = 1 CT_JAVASCRIPT ContentType = 2 CT_JSON ContentType = 3 CT_HTML ContentType = 4 CT_XML ContentType = 5 CT_MULTIPART_FORM_DATA ContentType = 6 CT_X_WWW_FORM_URLENCODED ContentType = 7 CT_BINARY ContentType = 8 )
func GetContentTypeFromString ¶
func GetContentTypeFromString(str string) ContentType
type Header ¶
type Header struct { Accept string AcceptCharset string AcceptEncoding string AcceptLanguage string Authorization string Charset string ContentType string ContentLength string ContentEncoding string ContentVersion string ContentLocation string ExtraFields Fields }
func (*Header) GetAllFields ¶
type IWebsocket ¶
type ListContentBinary ¶
type ListContentBinary []*ContentBinary
func NewListContentBinary ¶
func NewListContentBinary() ListContentBinary
func (*ListContentBinary) Add ¶
func (L *ListContentBinary) Add(name string, fileName string, value []byte)
func (*ListContentBinary) Clear ¶
func (L *ListContentBinary) Clear()
type ListContentFile ¶
type ListContentFile []*ContentFile
func NewListContentFile ¶
func NewListContentFile() ListContentFile
func (*ListContentFile) Add ¶
func (L *ListContentFile) Add(key string, fileName string, contentType string, content []byte)
func (*ListContentFile) Clear ¶
func (L *ListContentFile) Clear()
type ListContentFormField ¶
type ListContentFormField []*ContentFormField
func NewListContentFormField ¶
func NewListContentFormField() ListContentFormField
func (*ListContentFormField) Add ¶
func (L *ListContentFormField) Add(fieldName string, fieldValue string)
func (*ListContentFormField) Clear ¶
func (L *ListContentFormField) Clear()
type ListContentText ¶
type ListContentText []*ContentText
func NewListContentText ¶
func NewListContentText() ListContentText
func (*ListContentText) Clear ¶
func (L *ListContentText) Clear()
type Request ¶
type Request struct { Header *Header ItensFormField ListContentFormField ItensSubmitFile ListContentFile ItensContentText ListContentText ItensContentBin ListContentBinary Body []byte }
func NewRequest ¶
func NewRequest() *Request
func (*Request) AddContentBin ¶
func (*Request) AddFormField ¶
type Response ¶
func NewResponse ¶
func NewResponse() *Response
func (*Response) GetAllFields ¶
func (*Response) GetStatusCodeStr ¶
func (*Response) GetStatusMessage ¶
type THttp ¶
type THttp struct { /*publico*/ Auth2 *auth2 Request *Request Response *Response Metodo TMethod AuthorizationType AuthorizationType WebSocket *WebSocket Authorization string Password string UserName string Certificate TCert Protocolo string // http, https Host string // www.example.com Path string // /product Varibles Varibles Params Params Proxy *proxy EncType EncType Timeout int //segundos OnSend IWebsocket // contains filtered or unexported fields }
func (*THttp) Desconectar ¶
func (*THttp) EnviarBinarioTypeBinaryMessage ¶
func (*THttp) EnviarTextTypeTextMessage ¶
func (*THttp) GetAuthorizationType ¶
func (H *THttp) GetAuthorizationType() AuthorizationType
func (*THttp) GetFullURL ¶
func (*THttp) GetMetodoStr ¶
func (*THttp) SetAuthorizationType ¶
func (H *THttp) SetAuthorizationType(value AuthorizationType) error
func (*THttp) SetMetodoStr ¶
type TokenResponse ¶
type Varibles ¶
func NewVaribles ¶
func NewVaribles() Varibles
type WebSocket ¶ added in v1.0.61
type WebSocket struct { AutoReconnect bool NumberOfAttempts int // contains filtered or unexported fields }
func NewWebSocket ¶ added in v1.0.61
func NewWebSocket() *WebSocket
type Writer ¶ added in v1.0.80
type Writer struct {
// contains filtered or unexported fields
}
A Writer generates multipart messages.
func NewWriter ¶ added in v1.0.80
NewWriter returns a new multipart Writer with a random boundary, writing to w.
func (*Writer) Close ¶ added in v1.0.80
Close finishes the multipart message and writes the trailing boundary end line to the output.
func (*Writer) CreateFormField ¶ added in v1.0.80
CreateFormField calls CreatePart with a header using the given field name.
func (*Writer) CreateFormFile ¶ added in v1.0.80
CreateFormFile is a convenience wrapper around CreatePart. It creates a new form-data header with the provided field name and file name.
func (*Writer) CreateFormFile2 ¶ added in v1.0.80
func (*Writer) CreatePart ¶ added in v1.0.80
CreatePart creates a new multipart section with the provided header. The body of the part should be written to the returned Writer. After calling CreatePart, any previous part may no longer be written to.
func (*Writer) FormDataContentType ¶ added in v1.0.80
FormDataContentType returns the Content-Type for an HTTP multipart/form-data with this Writer's Boundary.
func (*Writer) SetBoundary ¶ added in v1.0.80
SetBoundary overrides the Writer's default randomly-generated boundary separator with an explicit value.
SetBoundary must be called before any parts are created, may only contain certain ASCII characters, and must be non-empty and at most 70 bytes long.
func (*Writer) WriteField ¶ added in v1.0.80
WriteField calls CreateFormField and then writes the given value.