mirait

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPITimeout = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PostTranslateRes added in v0.0.2

type PostTranslateRes struct {
	Status  string      `json:"status"`
	Outputs []outputRes `json:"outputs"`
}

{"status":"success","outputs":[{"output":"こんにちは。"}]}

type Session

type Session struct {
	URL        *url.URL
	HTTPClient *http.Client
	Token      string
	// contains filtered or unexported fields
}

func NewSession

func NewSession(cfg config.Config) (*Session, error)

func (*Session) DumpCookies

func (s *Session) DumpCookies() []config.Cookie

func (*Session) GetToken

func (s *Session) GetToken() (string, error)

func (*Session) PostTranslate

func (s *Session) PostTranslate(input string, isJP bool) (output string, err error)

func (*Session) Refresh

func (s *Session) Refresh() error

func (*Session) SetCacheCookie

func (s *Session) SetCacheCookie(ccs []config.Cookie)

func (*Session) SetToken

func (s *Session) SetToken(token string)

Jump to

Keyboard shortcuts

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