Documentation ¶
Index ¶
- Constants
- func CloneHeaders(h1 map[string]string, h2 map[string]string) map[string]string
- func ContainsString(stringList []string, s string) bool
- func GetIndentJson(v interface{}) (string, error)
- func GetStructTags(i interface{}) []string
- func IsUUID(s string) bool
- func LoadUserData(file string) (string, error)
- func RaiseIfError(err error, msg string)
- func UrlJoin(path ...string) string
- type BaseResponse
- type HttpError
- type ReaderWithProcess
- type Resource
- type Response
- func (resp Response) BodyString() string
- func (resp Response) BodyUnmarshal(object interface{}) error
- func (resp Response) GetContentLength() int
- func (resp Response) GetHeader(key string) string
- func (resp Response) IsNotFound() bool
- func (resp *Response) JudgeStatus() error
- func (resp *Response) ReadAll() error
- func (resp Response) SaveBody(file *os.File, process bool) error
- type RestfulClient
- func (c RestfulClient) Delete(url string, headers map[string]string) (*Response, error)
- func (c RestfulClient) Get(url string, query url.Values, headers map[string]string) (*Response, error)
- func (c RestfulClient) Post(url string, body []byte, headers map[string]string) (*Response, error)
- func (c RestfulClient) Put(url string, body []byte, headers map[string]string) (*Response, error)
- func (c RestfulClient) Request(req *http.Request) (*Response, error)
- type RestfulRequest
- func NewIndexRequest(endpoint string, query url.Values, headers map[string]string) RestfulRequest
- func NewResourceCreateRequest(endpoint string, resource string, body []byte, headers map[string]string) RestfulRequest
- func NewResourceDeleteRequest(endpoint string, resource string, id string, headers map[string]string) RestfulRequest
- func NewResourceListRequest(endpoint string, resource string, query url.Values, headers map[string]string) RestfulRequest
- func NewResourcePatchRequest(endpoint string, resource string, id string, body []byte, ...) RestfulRequest
- func NewResourcePutRequest(endpoint string, resource string, id string, body []byte, ...) RestfulRequest
- func NewResourceShowRequest(endpoint string, resource string, id string, headers map[string]string) RestfulRequest
- type Session
- type WriterWithProces
Constants ¶
View Source
const (
CODE_404 = 404
)
Variables ¶
This section is empty.
Functions ¶
func ContainsString ¶
func GetIndentJson ¶
func GetStructTags ¶
func GetStructTags(i interface{}) []string
func LoadUserData ¶
func RaiseIfError ¶
Types ¶
type BaseResponse ¶
type BaseResponse interface { BodyString() GetHeader() BodyUnmarshal(object interface{}) }
type HttpError ¶
func (HttpError) IsNotFound ¶
type ReaderWithProcess ¶
func (*ReaderWithProcess) PrintProcess ¶
func (reader *ReaderWithProcess) PrintProcess(r int)
type Resource ¶
type Resource struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Created string `json:"created,omitempty"` Updated string `json:"updated,omitempty"` ProjectId string `json:"project_id,omitempty"` TenantId string `json:"tenant_id,omitempty"` UserId string `json:"user_id,omitempty"` }
func (Resource) GetStructTags ¶
type Response ¶
type Response struct { Status int Reason string Body []byte Headers http.Header // contains filtered or unexported fields }
func (Response) BodyString ¶
func (Response) BodyUnmarshal ¶
func (Response) GetContentLength ¶
func (Response) IsNotFound ¶
func (*Response) JudgeStatus ¶
type RestfulClient ¶
type RestfulRequest ¶
type RestfulRequest struct { Endpoint string Method string Resource string Id string Query url.Values Body []byte Headers map[string]string ShowProcess bool }
func NewIndexRequest ¶
func NewResourceListRequest ¶
func NewResourcePatchRequest ¶
func NewResourcePutRequest ¶
func NewResourceShowRequest ¶
func (*RestfulRequest) Url ¶
func (request *RestfulRequest) Url() (string, error)
type WriterWithProces ¶
func (*WriterWithProces) PrintProcess ¶
func (reader *WriterWithProces) PrintProcess(r int)
Click to show internal directories.
Click to hide internal directories.