vh7

package
v0.0.0-...-1f29f83 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

func NewApiService

func NewApiService(httpClient *http.Client, apiUrl string) *ApiService

func (*ApiService) CreatePaste

func (s *ApiService) CreatePaste(code string, language string) (*Response, error)

func (*ApiService) CreateShorten

func (s *ApiService) CreateShorten(url string) (*Response, error)

func (*ApiService) CreateUpload

func (s *ApiService) CreateUpload(file *os.File) (*Response, error)

func (*ApiService) GetInfo

func (s *ApiService) GetInfo(link string) (*Response, error)

func (*ApiService) GetLanguages

func (s *ApiService) GetLanguages() (*[]Language, error)

type Language

type Language struct {
	Name string `json:"name"`
	Id   string `json:"id"`
}

type Paste

type Paste struct {
	Language string `json:"language"`
	Code     string `json:"code"`
	Hash     string `json:"hash,omitempty"`
}

type Response

type Response struct {
	Created UtcTime `json:"created"`
	Updated UtcTime `json:"updated"`
	Url     Url     `json:"url,omitempty"`
	Paste   Paste   `json:"paste,omitempty"`
	Upload  Upload  `json:"upload,omitempty"`
	Link    string  `json:"link"`
	Expiry  UtcTime `json:"expiry"`
}

func (*Response) GetSummary

func (r *Response) GetSummary() string

func (*Response) GetType

func (r *Response) GetType() string

type Upload

type Upload struct {
	Mimetype         string `json:"mimetype"`
	OriginalFilename string `json:"original_filename"`
	Hash             string `json:"hash"`
}

type Url

type Url struct {
	Url string `json:"url"`
}

type UtcTime

type UtcTime time.Time

func (UtcTime) MarshalJSON

func (u UtcTime) MarshalJSON() ([]byte, error)

func (*UtcTime) UnmarshalJSON

func (u *UtcTime) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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