repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
partition
stringclasses
1 value
markbates/goth
providers/battlenet/battlenet.go
FetchUser
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), RefreshToken: sess.RefreshToken, ExpiresAt: sess.ExpiresAt, } if user.AccessToken == "" { // data is not yet retrieved since acc...
go
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), RefreshToken: sess.RefreshToken, ExpiresAt: sess.ExpiresAt, } if user.AccessToken == "" { // data is not yet retrieved since acc...
[ "func", "(", "p", "*", "Provider", ")", "FetchUser", "(", "session", "goth", ".", "Session", ")", "(", "goth", ".", "User", ",", "error", ")", "{", "sess", ":=", "session", ".", "(", "*", "Session", ")", "\n", "user", ":=", "goth", ".", "User", "...
// FetchUser will go to Battle.net and access basic information about the user.
[ "FetchUser", "will", "go", "to", "Battle", ".", "net", "and", "access", "basic", "information", "about", "the", "user", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/battlenet/battlenet.go#L72-L124
train
markbates/goth
providers/twitter/twitter.go
FetchUser
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ Provider: p.Name(), } if sess.AccessToken == nil { // data is not yet retrieved since accessToken is still empty return user, fmt.Errorf("%s cannot get user information without accessToken", ...
go
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ Provider: p.Name(), } if sess.AccessToken == nil { // data is not yet retrieved since accessToken is still empty return user, fmt.Errorf("%s cannot get user information without accessToken", ...
[ "func", "(", "p", "*", "Provider", ")", "FetchUser", "(", "session", "goth", ".", "Session", ")", "(", "goth", ".", "User", ",", "error", ")", "{", "sess", ":=", "session", ".", "(", "*", "Session", ")", "\n", "user", ":=", "goth", ".", "User", "...
// FetchUser will go to Twitter and access basic information about the user.
[ "FetchUser", "will", "go", "to", "Twitter", "and", "access", "basic", "information", "about", "the", "user", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/twitter/twitter.go#L98-L140
train
markbates/goth
providers/spotify/session.go
Marshal
func (s Session) Marshal() string { j, _ := json.Marshal(s) return string(j) }
go
func (s Session) Marshal() string { j, _ := json.Marshal(s) return string(j) }
[ "func", "(", "s", "Session", ")", "Marshal", "(", ")", "string", "{", "j", ",", "_", ":=", "json", ".", "Marshal", "(", "s", ")", "\n", "return", "string", "(", "j", ")", "\n", "}" ]
// Marshal marshals a session into a JSON string.
[ "Marshal", "marshals", "a", "session", "into", "a", "JSON", "string", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/spotify/session.go#L48-L51
train
markbates/goth
providers/lastfm/session.go
Authorize
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) sess, err := p.GetSession(params.Get("token")) if err != nil { return "", err } s.AccessToken = sess["token"] s.Login = sess["login"] return sess["token"], err }
go
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) sess, err := p.GetSession(params.Get("token")) if err != nil { return "", err } s.AccessToken = sess["token"] s.Login = sess["login"] return sess["token"], err }
[ "func", "(", "s", "*", "Session", ")", "Authorize", "(", "provider", "goth", ".", "Provider", ",", "params", "goth", ".", "Params", ")", "(", "string", ",", "error", ")", "{", "p", ":=", "provider", ".", "(", "*", "Provider", ")", "\n", "sess", ","...
// Authorize the session with LastFM and return the access token to be stored for future use.
[ "Authorize", "the", "session", "with", "LastFM", "and", "return", "the", "access", "token", "to", "be", "stored", "for", "future", "use", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/lastfm/session.go#L27-L37
train
markbates/goth
providers/eveonline/eveonline.go
FetchUser
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), RefreshToken: sess.RefreshToken, ExpiresAt: sess.ExpiresAt, } if user.AccessToken == "" { // data is not yet retrieved since acc...
go
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), RefreshToken: sess.RefreshToken, ExpiresAt: sess.ExpiresAt, } if user.AccessToken == "" { // data is not yet retrieved since acc...
[ "func", "(", "p", "*", "Provider", ")", "FetchUser", "(", "session", "goth", ".", "Session", ")", "(", "goth", ".", "User", ",", "error", ")", "{", "sess", ":=", "session", ".", "(", "*", "Session", ")", "\n", "user", ":=", "goth", ".", "User", "...
// FetchUser will go to Eve Online and access basic information about the user.
[ "FetchUser", "will", "go", "to", "Eve", "Online", "and", "access", "basic", "information", "about", "the", "user", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/eveonline/eveonline.go#L73-L127
train
markbates/goth
providers/azuread/azuread.go
New
func New(clientKey, secret, callbackURL string, resources []string, scopes ...string) *Provider { p := &Provider{ ClientKey: clientKey, Secret: secret, CallbackURL: callbackURL, providerName: "azuread", } p.resources = make([]string, 0, 1+len(resources)) p.resources = append(p.resources, graphAPI...
go
func New(clientKey, secret, callbackURL string, resources []string, scopes ...string) *Provider { p := &Provider{ ClientKey: clientKey, Secret: secret, CallbackURL: callbackURL, providerName: "azuread", } p.resources = make([]string, 0, 1+len(resources)) p.resources = append(p.resources, graphAPI...
[ "func", "New", "(", "clientKey", ",", "secret", ",", "callbackURL", "string", ",", "resources", "[", "]", "string", ",", "scopes", "...", "string", ")", "*", "Provider", "{", "p", ":=", "&", "Provider", "{", "ClientKey", ":", "clientKey", ",", "Secret", ...
// New creates a new AzureAD provider, and sets up important connection details. // You should always call `AzureAD.New` to get a new Provider. Never try to create // one manually.
[ "New", "creates", "a", "new", "AzureAD", "provider", "and", "sets", "up", "important", "connection", "details", ".", "You", "should", "always", "call", "AzureAD", ".", "New", "to", "get", "a", "new", "Provider", ".", "Never", "try", "to", "create", "one", ...
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/azuread/azuread.go#L28-L42
train
markbates/goth
providers/azuread/azuread.go
BeginAuth
func (p *Provider) BeginAuth(state string) (goth.Session, error) { authURL := p.config.AuthCodeURL(state) // Azure ad requires at least one resource authURL += "&resource=" + url.QueryEscape(strings.Join(p.resources, " ")) return &Session{ AuthURL: authURL, }, nil }
go
func (p *Provider) BeginAuth(state string) (goth.Session, error) { authURL := p.config.AuthCodeURL(state) // Azure ad requires at least one resource authURL += "&resource=" + url.QueryEscape(strings.Join(p.resources, " ")) return &Session{ AuthURL: authURL, }, nil }
[ "func", "(", "p", "*", "Provider", ")", "BeginAuth", "(", "state", "string", ")", "(", "goth", ".", "Session", ",", "error", ")", "{", "authURL", ":=", "p", ".", "config", ".", "AuthCodeURL", "(", "state", ")", "\n\n", "// Azure ad requires at least one re...
// BeginAuth asks AzureAD for an authentication end-point.
[ "BeginAuth", "asks", "AzureAD", "for", "an", "authentication", "end", "-", "point", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/azuread/azuread.go#L74-L83
train
markbates/goth
providers/lastfm/lastfm.go
BeginAuth
func (p *Provider) BeginAuth(state string) (goth.Session, error) { urlParams := url.Values{} urlParams.Add("api_key", p.ClientKey) urlParams.Add("callback", p.CallbackURL) session := &Session{ AuthURL: authURL + "?" + urlParams.Encode(), } return session, nil }
go
func (p *Provider) BeginAuth(state string) (goth.Session, error) { urlParams := url.Values{} urlParams.Add("api_key", p.ClientKey) urlParams.Add("callback", p.CallbackURL) session := &Session{ AuthURL: authURL + "?" + urlParams.Encode(), } return session, nil }
[ "func", "(", "p", "*", "Provider", ")", "BeginAuth", "(", "state", "string", ")", "(", "goth", ".", "Session", ",", "error", ")", "{", "urlParams", ":=", "url", ".", "Values", "{", "}", "\n", "urlParams", ".", "Add", "(", "\"", "\"", ",", "p", "....
// BeginAuth asks LastFm for an authentication end-point
[ "BeginAuth", "asks", "LastFm", "for", "an", "authentication", "end", "-", "point" ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/lastfm/lastfm.go#L66-L76
train
markbates/goth
providers/lastfm/lastfm.go
FetchUser
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), } if user.AccessToken == "" { // data is not yet retrieved since accessToken is still empty return user, fmt.Errorf("%s has no user inf...
go
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), } if user.AccessToken == "" { // data is not yet retrieved since accessToken is still empty return user, fmt.Errorf("%s has no user inf...
[ "func", "(", "p", "*", "Provider", ")", "FetchUser", "(", "session", "goth", ".", "Session", ")", "(", "goth", ".", "User", ",", "error", ")", "{", "sess", ":=", "session", ".", "(", "*", "Session", ")", "\n", "user", ":=", "goth", ".", "User", "...
// FetchUser will go to LastFM and access basic information about the user.
[ "FetchUser", "will", "go", "to", "LastFM", "and", "access", "basic", "information", "about", "the", "user", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/lastfm/lastfm.go#L79-L126
train
markbates/goth
providers/lastfm/lastfm.go
GetSession
func (p *Provider) GetSession(token string) (map[string]string, error) { sess := struct { Name string `xml:"name"` Key string `xml:"key"` Subscriber bool `xml:"subscriber"` }{} err := p.request(true, map[string]string{"method": "auth.getSession", "token": token}, &sess) return map[string]strin...
go
func (p *Provider) GetSession(token string) (map[string]string, error) { sess := struct { Name string `xml:"name"` Key string `xml:"key"` Subscriber bool `xml:"subscriber"` }{} err := p.request(true, map[string]string{"method": "auth.getSession", "token": token}, &sess) return map[string]strin...
[ "func", "(", "p", "*", "Provider", ")", "GetSession", "(", "token", "string", ")", "(", "map", "[", "string", "]", "string", ",", "error", ")", "{", "sess", ":=", "struct", "{", "Name", "string", "`xml:\"name\"`", "\n", "Key", "string", "`xml:\"key\"`", ...
// GetSession token from LastFM
[ "GetSession", "token", "from", "LastFM" ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/lastfm/lastfm.go#L129-L138
train
markbates/goth
providers/vk/vk.go
FetchUser
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), ExpiresAt: sess.ExpiresAt, Email: sess.email, } if user.AccessToken == "" { return user, fmt.Errorf("%s cannot get user infor...
go
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), ExpiresAt: sess.ExpiresAt, Email: sess.email, } if user.AccessToken == "" { return user, fmt.Errorf("%s cannot get user infor...
[ "func", "(", "p", "*", "Provider", ")", "FetchUser", "(", "session", "goth", ".", "Session", ")", "(", "goth", ".", "User", ",", "error", ")", "{", "sess", ":=", "session", ".", "(", "*", "Session", ")", "\n", "user", ":=", "goth", ".", "User", "...
// FetchUser will go to VK and access basic information about the user.
[ "FetchUser", "will", "go", "to", "VK", "and", "access", "basic", "information", "about", "the", "user", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/vk/vk.go#L76-L110
train
markbates/goth
providers/github/github.go
New
func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { return NewCustomisedURL(clientKey, secret, callbackURL, AuthURL, TokenURL, ProfileURL, EmailURL, scopes...) }
go
func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { return NewCustomisedURL(clientKey, secret, callbackURL, AuthURL, TokenURL, ProfileURL, EmailURL, scopes...) }
[ "func", "New", "(", "clientKey", ",", "secret", ",", "callbackURL", "string", ",", "scopes", "...", "string", ")", "*", "Provider", "{", "return", "NewCustomisedURL", "(", "clientKey", ",", "secret", ",", "callbackURL", ",", "AuthURL", ",", "TokenURL", ",", ...
// New creates a new Github provider, and sets up important connection details. // You should always call `github.New` to get a new Provider. Never try to create // one manually.
[ "New", "creates", "a", "new", "Github", "provider", "and", "sets", "up", "important", "connection", "details", ".", "You", "should", "always", "call", "github", ".", "New", "to", "get", "a", "new", "Provider", ".", "Never", "try", "to", "create", "one", ...
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/github/github.go#L39-L41
train
markbates/goth
providers/github/github.go
FetchUser
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), } if user.AccessToken == "" { // data is not yet retrieved since accessToken is still empty return user, fmt.Errorf("%s cannot get user...
go
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), } if user.AccessToken == "" { // data is not yet retrieved since accessToken is still empty return user, fmt.Errorf("%s cannot get user...
[ "func", "(", "p", "*", "Provider", ")", "FetchUser", "(", "session", "goth", ".", "Session", ")", "(", "goth", ".", "User", ",", "error", ")", "{", "sess", ":=", "session", ".", "(", "*", "Session", ")", "\n", "user", ":=", "goth", ".", "User", "...
// FetchUser will go to Github and access basic information about the user.
[ "FetchUser", "will", "go", "to", "Github", "and", "access", "basic", "information", "about", "the", "user", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/github/github.go#L96-L145
train
markbates/goth
providers/vk/session.go
GetAuthURL
func (s *Session) GetAuthURL() (string, error) { if s.AuthURL == "" { return "", errors.New(goth.NoAuthUrlErrorMessage) } return s.AuthURL, nil }
go
func (s *Session) GetAuthURL() (string, error) { if s.AuthURL == "" { return "", errors.New(goth.NoAuthUrlErrorMessage) } return s.AuthURL, nil }
[ "func", "(", "s", "*", "Session", ")", "GetAuthURL", "(", ")", "(", "string", ",", "error", ")", "{", "if", "s", ".", "AuthURL", "==", "\"", "\"", "{", "return", "\"", "\"", ",", "errors", ".", "New", "(", "goth", ".", "NoAuthUrlErrorMessage", ")",...
// GetAuthURL returns the URL for the authentication end-point for the provider.
[ "GetAuthURL", "returns", "the", "URL", "for", "the", "authentication", "end", "-", "point", "for", "the", "provider", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/vk/session.go#L21-L26
train
markbates/goth
providers/vk/session.go
Authorize
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) token, err := p.config.Exchange(goth.ContextForClient(p.Client()), params.Get("code")) if err != nil { return "", err } if !token.Valid() { return "", errors.New("Invalid token received from pro...
go
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) token, err := p.config.Exchange(goth.ContextForClient(p.Client()), params.Get("code")) if err != nil { return "", err } if !token.Valid() { return "", errors.New("Invalid token received from pro...
[ "func", "(", "s", "*", "Session", ")", "Authorize", "(", "provider", "goth", ".", "Provider", ",", "params", "goth", ".", "Params", ")", "(", "string", ",", "error", ")", "{", "p", ":=", "provider", ".", "(", "*", "Provider", ")", "\n", "token", ",...
// Authorize the session with VK and return the access token to be stored for future use.
[ "Authorize", "the", "session", "with", "VK", "and", "return", "the", "access", "token", "to", "be", "stored", "for", "future", "use", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/vk/session.go#L35-L55
train
markbates/goth
providers/tumblr/session.go
Authorize
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) accessToken, err := p.consumer.AuthorizeToken(s.RequestToken, params.Get("oauth_verifier")) if err != nil { return "", err } s.AccessToken = accessToken return accessToken.Token, err }
go
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) accessToken, err := p.consumer.AuthorizeToken(s.RequestToken, params.Get("oauth_verifier")) if err != nil { return "", err } s.AccessToken = accessToken return accessToken.Token, err }
[ "func", "(", "s", "*", "Session", ")", "Authorize", "(", "provider", "goth", ".", "Provider", ",", "params", "goth", ".", "Params", ")", "(", "string", ",", "error", ")", "{", "p", ":=", "provider", ".", "(", "*", "Provider", ")", "\n", "accessToken"...
// Authorize the session with Tumblr and return the access token to be stored for future use.
[ "Authorize", "the", "session", "with", "Tumblr", "and", "return", "the", "access", "token", "to", "be", "stored", "for", "future", "use", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/tumblr/session.go#L28-L37
train
markbates/goth
providers/facebook/facebook.go
FetchUser
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), ExpiresAt: sess.ExpiresAt, } if user.AccessToken == "" { // data is not yet retrieved since accessToken is still empty return user,...
go
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) user := goth.User{ AccessToken: sess.AccessToken, Provider: p.Name(), ExpiresAt: sess.ExpiresAt, } if user.AccessToken == "" { // data is not yet retrieved since accessToken is still empty return user,...
[ "func", "(", "p", "*", "Provider", ")", "FetchUser", "(", "session", "goth", ".", "Session", ")", "(", "goth", ".", "User", ",", "error", ")", "{", "sess", ":=", "session", ".", "(", "*", "Session", ")", "\n", "user", ":=", "goth", ".", "User", "...
// FetchUser will go to Facebook and access basic information about the user.
[ "FetchUser", "will", "go", "to", "Facebook", "and", "access", "basic", "information", "about", "the", "user", "." ]
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/facebook/facebook.go#L92-L142
train
markbates/goth
providers/cloudfoundry/cf.go
New
func New(uaaURL, clientKey, secret, callbackURL string, scopes ...string) *Provider { uaaURL = strings.TrimSuffix(uaaURL, "/") p := &Provider{ ClientKey: clientKey, Secret: secret, CallbackURL: callbackURL, AuthURL: uaaURL + "/oauth/authorize", TokenURL: uaaURL + "/oauth/token", UserInf...
go
func New(uaaURL, clientKey, secret, callbackURL string, scopes ...string) *Provider { uaaURL = strings.TrimSuffix(uaaURL, "/") p := &Provider{ ClientKey: clientKey, Secret: secret, CallbackURL: callbackURL, AuthURL: uaaURL + "/oauth/authorize", TokenURL: uaaURL + "/oauth/token", UserInf...
[ "func", "New", "(", "uaaURL", ",", "clientKey", ",", "secret", ",", "callbackURL", "string", ",", "scopes", "...", "string", ")", "*", "Provider", "{", "uaaURL", "=", "strings", ".", "TrimSuffix", "(", "uaaURL", ",", "\"", "\"", ")", "\n", "p", ":=", ...
// New creates a new Cloud Foundry provider and sets up important connection details. // You should always call `cloudfoundry.New` to get a new provider. Never try to // create one manually.
[ "New", "creates", "a", "new", "Cloud", "Foundry", "provider", "and", "sets", "up", "important", "connection", "details", ".", "You", "should", "always", "call", "cloudfoundry", ".", "New", "to", "get", "a", "new", "provider", ".", "Never", "try", "to", "cr...
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/cloudfoundry/cf.go#L35-L48
train
markbates/goth
providers/naver/naver.go
New
func New(clientKey, secret, callbackURL string) *Provider { p := &Provider{ ClientKey: clientKey, Secret: secret, CallbackURL: callbackURL, providerName: "naver", } p.config = newConfig(p) return p }
go
func New(clientKey, secret, callbackURL string) *Provider { p := &Provider{ ClientKey: clientKey, Secret: secret, CallbackURL: callbackURL, providerName: "naver", } p.config = newConfig(p) return p }
[ "func", "New", "(", "clientKey", ",", "secret", ",", "callbackURL", "string", ")", "*", "Provider", "{", "p", ":=", "&", "Provider", "{", "ClientKey", ":", "clientKey", ",", "Secret", ":", "secret", ",", "CallbackURL", ":", "callbackURL", ",", "providerNam...
// New creates a New provider and sets up important connection details. // You should always call `naver.New` to get a new Provider. Never try to craete // one manually. // Currently Naver only supports pre-defined scopes. // You should visit Naver Developer page in order to define your application's oauth scope.
[ "New", "creates", "a", "New", "provider", "and", "sets", "up", "important", "connection", "details", ".", "You", "should", "always", "call", "naver", ".", "New", "to", "get", "a", "new", "Provider", ".", "Never", "try", "to", "craete", "one", "manually", ...
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/naver/naver.go#L122-L131
train
markbates/goth
providers/paypal/paypal.go
New
func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { paypalEnv := os.Getenv(envKey) authURL := authURLProduction tokenURL := tokenURLProduction profileEndPoint := endpointProfileProduction if paypalEnv == sandbox { authURL = authURLSandbox tokenURL = tokenURLSandbox profileEndPoint...
go
func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { paypalEnv := os.Getenv(envKey) authURL := authURLProduction tokenURL := tokenURLProduction profileEndPoint := endpointProfileProduction if paypalEnv == sandbox { authURL = authURLSandbox tokenURL = tokenURLSandbox profileEndPoint...
[ "func", "New", "(", "clientKey", ",", "secret", ",", "callbackURL", "string", ",", "scopes", "...", "string", ")", "*", "Provider", "{", "paypalEnv", ":=", "os", ".", "Getenv", "(", "envKey", ")", "\n\n", "authURL", ":=", "authURLProduction", "\n", "tokenU...
// New creates a new Paypal provider and sets up important connection details. // You should always call `paypal.New` to get a new provider. Never try to // create one manually.
[ "New", "creates", "a", "new", "Paypal", "provider", "and", "sets", "up", "important", "connection", "details", ".", "You", "should", "always", "call", "paypal", ".", "New", "to", "get", "a", "new", "provider", ".", "Never", "try", "to", "create", "one", ...
9db62076e0965a39b5a282e506e0aec27d2b1625
https://github.com/markbates/goth/blob/9db62076e0965a39b5a282e506e0aec27d2b1625/providers/paypal/paypal.go#L48-L62
train
songgao/water
syscalls_windows.go
setStatus
func setStatus(fd syscall.Handle, status bool) error { var bytesReturned uint32 rdbbuf := make([]byte, syscall.MAXIMUM_REPARSE_DATA_BUFFER_SIZE) code := []byte{0x00, 0x00, 0x00, 0x00} if status { code[0] = 0x01 } return syscall.DeviceIoControl(fd, tap_ioctl_set_media_status, &code[0], uint32(4), &rdbbuf[0], uin...
go
func setStatus(fd syscall.Handle, status bool) error { var bytesReturned uint32 rdbbuf := make([]byte, syscall.MAXIMUM_REPARSE_DATA_BUFFER_SIZE) code := []byte{0x00, 0x00, 0x00, 0x00} if status { code[0] = 0x01 } return syscall.DeviceIoControl(fd, tap_ioctl_set_media_status, &code[0], uint32(4), &rdbbuf[0], uin...
[ "func", "setStatus", "(", "fd", "syscall", ".", "Handle", ",", "status", "bool", ")", "error", "{", "var", "bytesReturned", "uint32", "\n", "rdbbuf", ":=", "make", "(", "[", "]", "byte", ",", "syscall", ".", "MAXIMUM_REPARSE_DATA_BUFFER_SIZE", ")", "\n", "...
// setStatus is used to bring up or bring down the interface
[ "setStatus", "is", "used", "to", "bring", "up", "or", "bring", "down", "the", "interface" ]
6ad6edefb15c9ffe418e722c13459ab16a545d2b
https://github.com/songgao/water/blob/6ad6edefb15c9ffe418e722c13459ab16a545d2b/syscalls_windows.go#L200-L208
train
songgao/water
syscalls_windows.go
setTUN
func setTUN(fd syscall.Handle, network string) error { var bytesReturned uint32 rdbbuf := make([]byte, syscall.MAXIMUM_REPARSE_DATA_BUFFER_SIZE) localIP, remoteNet, err := net.ParseCIDR(network) if err != nil { return fmt.Errorf("Failed to parse network CIDR in config, %v", err) } if localIP.To4() == nil { r...
go
func setTUN(fd syscall.Handle, network string) error { var bytesReturned uint32 rdbbuf := make([]byte, syscall.MAXIMUM_REPARSE_DATA_BUFFER_SIZE) localIP, remoteNet, err := net.ParseCIDR(network) if err != nil { return fmt.Errorf("Failed to parse network CIDR in config, %v", err) } if localIP.To4() == nil { r...
[ "func", "setTUN", "(", "fd", "syscall", ".", "Handle", ",", "network", "string", ")", "error", "{", "var", "bytesReturned", "uint32", "\n", "rdbbuf", ":=", "make", "(", "[", "]", "byte", ",", "syscall", ".", "MAXIMUM_REPARSE_DATA_BUFFER_SIZE", ")", "\n\n", ...
// setTUN is used to configure the IP address in the underlying driver when using TUN
[ "setTUN", "is", "used", "to", "configure", "the", "IP", "address", "in", "the", "underlying", "driver", "when", "using", "TUN" ]
6ad6edefb15c9ffe418e722c13459ab16a545d2b
https://github.com/songgao/water/blob/6ad6edefb15c9ffe418e722c13459ab16a545d2b/syscalls_windows.go#L211-L233
train
songgao/water
syscalls_windows.go
openDev
func openDev(config Config) (ifce *Interface, err error) { // find the device in registry. deviceid, err := getdeviceid(config.PlatformSpecificParams.ComponentID, config.PlatformSpecificParams.InterfaceName) if err != nil { return nil, err } path := "\\\\.\\Global\\" + deviceid + ".tap" pathp, err := syscall.UT...
go
func openDev(config Config) (ifce *Interface, err error) { // find the device in registry. deviceid, err := getdeviceid(config.PlatformSpecificParams.ComponentID, config.PlatformSpecificParams.InterfaceName) if err != nil { return nil, err } path := "\\\\.\\Global\\" + deviceid + ".tap" pathp, err := syscall.UT...
[ "func", "openDev", "(", "config", "Config", ")", "(", "ifce", "*", "Interface", ",", "err", "error", ")", "{", "// find the device in registry.", "deviceid", ",", "err", ":=", "getdeviceid", "(", "config", ".", "PlatformSpecificParams", ".", "ComponentID", ",", ...
// openDev find and open an interface.
[ "openDev", "find", "and", "open", "an", "interface", "." ]
6ad6edefb15c9ffe418e722c13459ab16a545d2b
https://github.com/songgao/water/blob/6ad6edefb15c9ffe418e722c13459ab16a545d2b/syscalls_windows.go#L236-L308
train
hprose/hprose-golang
rpc/hd_socket_trans.go
SetMaxPoolSize
func (hd *halfDuplexSocketTransport) SetMaxPoolSize(size int) { if size > 0 { pool := make(chan *halfDuplexConnEntry, size) for i := 0; i < len(hd.connPool); i++ { select { case pool <- <-hd.connPool: default: } } hd.connPool = pool } }
go
func (hd *halfDuplexSocketTransport) SetMaxPoolSize(size int) { if size > 0 { pool := make(chan *halfDuplexConnEntry, size) for i := 0; i < len(hd.connPool); i++ { select { case pool <- <-hd.connPool: default: } } hd.connPool = pool } }
[ "func", "(", "hd", "*", "halfDuplexSocketTransport", ")", "SetMaxPoolSize", "(", "size", "int", ")", "{", "if", "size", ">", "0", "{", "pool", ":=", "make", "(", "chan", "*", "halfDuplexConnEntry", ",", "size", ")", "\n", "for", "i", ":=", "0", ";", ...
// SetMaxPoolSize sets the max conn pool size of hprose socket client
[ "SetMaxPoolSize", "sets", "the", "max", "conn", "pool", "size", "of", "hprose", "socket", "client" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/hd_socket_trans.go#L74-L85
train
hprose/hprose-golang
rpc/websocket/websocket_client.go
NewWebSocketClient
func NewWebSocketClient(uri ...string) (client *WebSocketClient) { client = new(WebSocketClient) client.InitBaseClient() client.limiter.InitLimiter() client.closed = false client.SetURIList(uri) client.SendAndReceive = client.sendAndReceive return }
go
func NewWebSocketClient(uri ...string) (client *WebSocketClient) { client = new(WebSocketClient) client.InitBaseClient() client.limiter.InitLimiter() client.closed = false client.SetURIList(uri) client.SendAndReceive = client.sendAndReceive return }
[ "func", "NewWebSocketClient", "(", "uri", "...", "string", ")", "(", "client", "*", "WebSocketClient", ")", "{", "client", "=", "new", "(", "WebSocketClient", ")", "\n", "client", ".", "InitBaseClient", "(", ")", "\n", "client", ".", "limiter", ".", "InitL...
// NewWebSocketClient is the constructor of WebSocketClient
[ "NewWebSocketClient", "is", "the", "constructor", "of", "WebSocketClient" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/websocket/websocket_client.go#L59-L67
train
hprose/hprose-golang
rpc/websocket/websocket_client.go
Close
func (client *WebSocketClient) Close() { client.closed = true client.close(rpc.ErrClientIsAlreadyClosed) }
go
func (client *WebSocketClient) Close() { client.closed = true client.close(rpc.ErrClientIsAlreadyClosed) }
[ "func", "(", "client", "*", "WebSocketClient", ")", "Close", "(", ")", "{", "client", ".", "closed", "=", "true", "\n", "client", ".", "close", "(", "rpc", ".", "ErrClientIsAlreadyClosed", ")", "\n", "}" ]
// Close the client
[ "Close", "the", "client" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/websocket/websocket_client.go#L98-L101
train
hprose/hprose-golang
rpc/handler.go
AddInvokeHandler
func (hm *handlerManager) AddInvokeHandler(handler ...InvokeHandler) { if len(handler) == 0 { return } hm.invokeHandlers = append(hm.invokeHandlers, handler...) next := hm.defaultInvokeHandler for i := len(hm.invokeHandlers) - 1; i >= 0; i-- { next = getNextInvokeHandler(next, hm.invokeHandlers[i]) } hm.invo...
go
func (hm *handlerManager) AddInvokeHandler(handler ...InvokeHandler) { if len(handler) == 0 { return } hm.invokeHandlers = append(hm.invokeHandlers, handler...) next := hm.defaultInvokeHandler for i := len(hm.invokeHandlers) - 1; i >= 0; i-- { next = getNextInvokeHandler(next, hm.invokeHandlers[i]) } hm.invo...
[ "func", "(", "hm", "*", "handlerManager", ")", "AddInvokeHandler", "(", "handler", "...", "InvokeHandler", ")", "{", "if", "len", "(", "handler", ")", "==", "0", "{", "return", "\n", "}", "\n", "hm", ".", "invokeHandlers", "=", "append", "(", "hm", "."...
// AddInvokeHandler add the invoke handler
[ "AddInvokeHandler", "add", "the", "invoke", "handler" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/handler.go#L142-L152
train
hprose/hprose-golang
io/writer.go
NewWriter
func NewWriter(simple bool, buf ...byte) (w *Writer) { w = new(Writer) w.buf = buf w.Simple = simple return }
go
func NewWriter(simple bool, buf ...byte) (w *Writer) { w = new(Writer) w.buf = buf w.Simple = simple return }
[ "func", "NewWriter", "(", "simple", "bool", ",", "buf", "...", "byte", ")", "(", "w", "*", "Writer", ")", "{", "w", "=", "new", "(", "Writer", ")", "\n", "w", ".", "buf", "=", "buf", "\n", "w", ".", "Simple", "=", "simple", "\n", "return", "\n"...
// NewWriter is the constructor for Hprose Writer
[ "NewWriter", "is", "the", "constructor", "for", "Hprose", "Writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L45-L50
train
hprose/hprose-golang
io/writer.go
Serialize
func (w *Writer) Serialize(v interface{}) *Writer { if v == nil { w.WriteNil() } else if rv, ok := v.(reflect.Value); ok { w.WriteValue(rv) } else { w.WriteValue(reflect.ValueOf(v)) } return w }
go
func (w *Writer) Serialize(v interface{}) *Writer { if v == nil { w.WriteNil() } else if rv, ok := v.(reflect.Value); ok { w.WriteValue(rv) } else { w.WriteValue(reflect.ValueOf(v)) } return w }
[ "func", "(", "w", "*", "Writer", ")", "Serialize", "(", "v", "interface", "{", "}", ")", "*", "Writer", "{", "if", "v", "==", "nil", "{", "w", ".", "WriteNil", "(", ")", "\n", "}", "else", "if", "rv", ",", "ok", ":=", "v", ".", "(", "reflect"...
// Serialize a data v to the writer
[ "Serialize", "a", "data", "v", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L53-L62
train
hprose/hprose-golang
io/writer.go
WriteValue
func (w *Writer) WriteValue(v reflect.Value) { valueEncoders[v.Kind()](w, v) }
go
func (w *Writer) WriteValue(v reflect.Value) { valueEncoders[v.Kind()](w, v) }
[ "func", "(", "w", "*", "Writer", ")", "WriteValue", "(", "v", "reflect", ".", "Value", ")", "{", "valueEncoders", "[", "v", ".", "Kind", "(", ")", "]", "(", "w", ",", "v", ")", "\n", "}" ]
// WriteValue to the writer
[ "WriteValue", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L65-L67
train
hprose/hprose-golang
io/writer.go
WriteBool
func (w *Writer) WriteBool(b bool) { if b { w.writeByte(TagTrue) } else { w.writeByte(TagFalse) } }
go
func (w *Writer) WriteBool(b bool) { if b { w.writeByte(TagTrue) } else { w.writeByte(TagFalse) } }
[ "func", "(", "w", "*", "Writer", ")", "WriteBool", "(", "b", "bool", ")", "{", "if", "b", "{", "w", ".", "writeByte", "(", "TagTrue", ")", "\n", "}", "else", "{", "w", ".", "writeByte", "(", "TagFalse", ")", "\n", "}", "\n", "}" ]
// WriteBool to the writer
[ "WriteBool", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L75-L81
train
hprose/hprose-golang
io/writer.go
WriteInt
func (w *Writer) WriteInt(i int64) { if i >= 0 && i <= 9 { w.writeByte(byte('0' + i)) return } if i >= math.MinInt32 && i <= math.MaxInt32 { w.writeByte(TagInteger) } else { w.writeByte(TagLong) } var buf [20]byte w.write(util.GetIntBytes(buf[:], i)) w.writeByte(TagSemicolon) }
go
func (w *Writer) WriteInt(i int64) { if i >= 0 && i <= 9 { w.writeByte(byte('0' + i)) return } if i >= math.MinInt32 && i <= math.MaxInt32 { w.writeByte(TagInteger) } else { w.writeByte(TagLong) } var buf [20]byte w.write(util.GetIntBytes(buf[:], i)) w.writeByte(TagSemicolon) }
[ "func", "(", "w", "*", "Writer", ")", "WriteInt", "(", "i", "int64", ")", "{", "if", "i", ">=", "0", "&&", "i", "<=", "9", "{", "w", ".", "writeByte", "(", "byte", "(", "'0'", "+", "i", ")", ")", "\n", "return", "\n", "}", "\n", "if", "i", ...
// WriteInt to the writer
[ "WriteInt", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L84-L97
train
hprose/hprose-golang
io/writer.go
WriteUint
func (w *Writer) WriteUint(i uint64) { if i <= 9 { w.writeByte(byte('0' + i)) return } if i <= math.MaxInt32 { w.writeByte(TagInteger) } else { w.writeByte(TagLong) } var buf [20]byte w.write(util.GetUintBytes(buf[:], i)) w.writeByte(TagSemicolon) }
go
func (w *Writer) WriteUint(i uint64) { if i <= 9 { w.writeByte(byte('0' + i)) return } if i <= math.MaxInt32 { w.writeByte(TagInteger) } else { w.writeByte(TagLong) } var buf [20]byte w.write(util.GetUintBytes(buf[:], i)) w.writeByte(TagSemicolon) }
[ "func", "(", "w", "*", "Writer", ")", "WriteUint", "(", "i", "uint64", ")", "{", "if", "i", "<=", "9", "{", "w", ".", "writeByte", "(", "byte", "(", "'0'", "+", "i", ")", ")", "\n", "return", "\n", "}", "\n", "if", "i", "<=", "math", ".", "...
// WriteUint to the writer
[ "WriteUint", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L100-L113
train
hprose/hprose-golang
io/writer.go
WriteFloat
func (w *Writer) WriteFloat(f float64, bitSize int) { if f != f { w.writeByte(TagNaN) return } if f > math.MaxFloat64 { w.write([]byte{TagInfinity, TagPos}) return } if f < -math.MaxFloat64 { w.write([]byte{TagInfinity, TagNeg}) return } w.writeByte(TagDouble) var buf [64]byte w.write(strconv.Appen...
go
func (w *Writer) WriteFloat(f float64, bitSize int) { if f != f { w.writeByte(TagNaN) return } if f > math.MaxFloat64 { w.write([]byte{TagInfinity, TagPos}) return } if f < -math.MaxFloat64 { w.write([]byte{TagInfinity, TagNeg}) return } w.writeByte(TagDouble) var buf [64]byte w.write(strconv.Appen...
[ "func", "(", "w", "*", "Writer", ")", "WriteFloat", "(", "f", "float64", ",", "bitSize", "int", ")", "{", "if", "f", "!=", "f", "{", "w", ".", "writeByte", "(", "TagNaN", ")", "\n", "return", "\n", "}", "\n", "if", "f", ">", "math", ".", "MaxFl...
// WriteFloat to the writer
[ "WriteFloat", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L116-L133
train
hprose/hprose-golang
io/writer.go
WriteComplex64
func (w *Writer) WriteComplex64(c complex64) { if imag(c) == 0 { w.WriteFloat(float64(real(c)), 32) return } setWriterRef(w, nil, nil) writeListHeader(w, 2) w.WriteFloat(float64(real(c)), 32) w.WriteFloat(float64(imag(c)), 32) writeListFooter(w) }
go
func (w *Writer) WriteComplex64(c complex64) { if imag(c) == 0 { w.WriteFloat(float64(real(c)), 32) return } setWriterRef(w, nil, nil) writeListHeader(w, 2) w.WriteFloat(float64(real(c)), 32) w.WriteFloat(float64(imag(c)), 32) writeListFooter(w) }
[ "func", "(", "w", "*", "Writer", ")", "WriteComplex64", "(", "c", "complex64", ")", "{", "if", "imag", "(", "c", ")", "==", "0", "{", "w", ".", "WriteFloat", "(", "float64", "(", "real", "(", "c", ")", ")", ",", "32", ")", "\n", "return", "\n",...
// WriteComplex64 to the writer
[ "WriteComplex64", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L136-L146
train
hprose/hprose-golang
io/writer.go
WriteComplex128
func (w *Writer) WriteComplex128(c complex128) { if imag(c) == 0 { w.WriteFloat(real(c), 64) return } setWriterRef(w, nil, nil) writeListHeader(w, 2) w.WriteFloat(real(c), 64) w.WriteFloat(imag(c), 64) writeListFooter(w) }
go
func (w *Writer) WriteComplex128(c complex128) { if imag(c) == 0 { w.WriteFloat(real(c), 64) return } setWriterRef(w, nil, nil) writeListHeader(w, 2) w.WriteFloat(real(c), 64) w.WriteFloat(imag(c), 64) writeListFooter(w) }
[ "func", "(", "w", "*", "Writer", ")", "WriteComplex128", "(", "c", "complex128", ")", "{", "if", "imag", "(", "c", ")", "==", "0", "{", "w", ".", "WriteFloat", "(", "real", "(", "c", ")", ",", "64", ")", "\n", "return", "\n", "}", "\n", "setWri...
// WriteComplex128 to the writer
[ "WriteComplex128", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L149-L159
train
hprose/hprose-golang
io/writer.go
WriteString
func (w *Writer) WriteString(str string) { length := util.UTF16Length(str) switch { case length == 0: w.writeByte(TagEmpty) case length < 0: w.WriteBytes(*(*[]byte)(unsafe.Pointer(&str))) case length == 1: w.writeByte(TagUTF8Char) w.writeString(str) default: setWriterRef(w, nil, nil) writeString(w, st...
go
func (w *Writer) WriteString(str string) { length := util.UTF16Length(str) switch { case length == 0: w.writeByte(TagEmpty) case length < 0: w.WriteBytes(*(*[]byte)(unsafe.Pointer(&str))) case length == 1: w.writeByte(TagUTF8Char) w.writeString(str) default: setWriterRef(w, nil, nil) writeString(w, st...
[ "func", "(", "w", "*", "Writer", ")", "WriteString", "(", "str", "string", ")", "{", "length", ":=", "util", ".", "UTF16Length", "(", "str", ")", "\n", "switch", "{", "case", "length", "==", "0", ":", "w", ".", "writeByte", "(", "TagEmpty", ")", "\...
// WriteString to the writer
[ "WriteString", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L162-L176
train
hprose/hprose-golang
io/writer.go
WriteBytes
func (w *Writer) WriteBytes(bytes []byte) { setWriterRef(w, nil, nil) writeBytes(w, bytes) }
go
func (w *Writer) WriteBytes(bytes []byte) { setWriterRef(w, nil, nil) writeBytes(w, bytes) }
[ "func", "(", "w", "*", "Writer", ")", "WriteBytes", "(", "bytes", "[", "]", "byte", ")", "{", "setWriterRef", "(", "w", ",", "nil", ",", "nil", ")", "\n", "writeBytes", "(", "w", ",", "bytes", ")", "\n", "}" ]
// WriteBytes to the writer
[ "WriteBytes", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L179-L182
train
hprose/hprose-golang
io/writer.go
WriteBigInt
func (w *Writer) WriteBigInt(bi *big.Int) { w.writeByte(TagLong) w.writeString(bi.String()) w.writeByte(TagSemicolon) }
go
func (w *Writer) WriteBigInt(bi *big.Int) { w.writeByte(TagLong) w.writeString(bi.String()) w.writeByte(TagSemicolon) }
[ "func", "(", "w", "*", "Writer", ")", "WriteBigInt", "(", "bi", "*", "big", ".", "Int", ")", "{", "w", ".", "writeByte", "(", "TagLong", ")", "\n", "w", ".", "writeString", "(", "bi", ".", "String", "(", ")", ")", "\n", "w", ".", "writeByte", "...
// WriteBigInt to the writer
[ "WriteBigInt", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L185-L189
train
hprose/hprose-golang
io/writer.go
WriteBigRat
func (w *Writer) WriteBigRat(br *big.Rat) { if br.IsInt() { w.WriteBigInt(br.Num()) } else { str := br.String() setWriterRef(w, nil, nil) writeString(w, str, len(str)) } }
go
func (w *Writer) WriteBigRat(br *big.Rat) { if br.IsInt() { w.WriteBigInt(br.Num()) } else { str := br.String() setWriterRef(w, nil, nil) writeString(w, str, len(str)) } }
[ "func", "(", "w", "*", "Writer", ")", "WriteBigRat", "(", "br", "*", "big", ".", "Rat", ")", "{", "if", "br", ".", "IsInt", "(", ")", "{", "w", ".", "WriteBigInt", "(", "br", ".", "Num", "(", ")", ")", "\n", "}", "else", "{", "str", ":=", "...
// WriteBigRat to the writer
[ "WriteBigRat", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L192-L200
train
hprose/hprose-golang
io/writer.go
WriteBigFloat
func (w *Writer) WriteBigFloat(bf *big.Float) { w.writeByte(TagDouble) var buf [64]byte w.write(bf.Append(buf[:0], 'g', -1)) w.writeByte(TagSemicolon) }
go
func (w *Writer) WriteBigFloat(bf *big.Float) { w.writeByte(TagDouble) var buf [64]byte w.write(bf.Append(buf[:0], 'g', -1)) w.writeByte(TagSemicolon) }
[ "func", "(", "w", "*", "Writer", ")", "WriteBigFloat", "(", "bf", "*", "big", ".", "Float", ")", "{", "w", ".", "writeByte", "(", "TagDouble", ")", "\n", "var", "buf", "[", "64", "]", "byte", "\n", "w", ".", "write", "(", "bf", ".", "Append", "...
// WriteBigFloat to the writer
[ "WriteBigFloat", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L203-L208
train
hprose/hprose-golang
io/writer.go
WriteTime
func (w *Writer) WriteTime(t *time.Time) { ptr := unsafe.Pointer(t) typ := reflect.TypeOf(t) if writeRef(w, ptr, typ) { return } setWriterRef(w, ptr, typ) year, month, day := t.Date() hour, min, sec := t.Clock() nsec := t.Nanosecond() buf := make([]byte, 9) if hour == 0 && min == 0 && sec == 0 && nsec == 0 ...
go
func (w *Writer) WriteTime(t *time.Time) { ptr := unsafe.Pointer(t) typ := reflect.TypeOf(t) if writeRef(w, ptr, typ) { return } setWriterRef(w, ptr, typ) year, month, day := t.Date() hour, min, sec := t.Clock() nsec := t.Nanosecond() buf := make([]byte, 9) if hour == 0 && min == 0 && sec == 0 && nsec == 0 ...
[ "func", "(", "w", "*", "Writer", ")", "WriteTime", "(", "t", "*", "time", ".", "Time", ")", "{", "ptr", ":=", "unsafe", ".", "Pointer", "(", "t", ")", "\n", "typ", ":=", "reflect", ".", "TypeOf", "(", "t", ")", "\n", "if", "writeRef", "(", "w",...
// WriteTime to the writer
[ "WriteTime", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L225-L249
train
hprose/hprose-golang
io/writer.go
WriteList
func (w *Writer) WriteList(lst *list.List) { ptr := unsafe.Pointer(lst) typ := reflect.TypeOf(lst) if writeRef(w, ptr, typ) { return } setWriterRef(w, ptr, typ) count := lst.Len() if count == 0 { writeEmptyList(w) return } writeListHeader(w, count) for e := lst.Front(); e != nil; e = e.Next() { w.Seri...
go
func (w *Writer) WriteList(lst *list.List) { ptr := unsafe.Pointer(lst) typ := reflect.TypeOf(lst) if writeRef(w, ptr, typ) { return } setWriterRef(w, ptr, typ) count := lst.Len() if count == 0 { writeEmptyList(w) return } writeListHeader(w, count) for e := lst.Front(); e != nil; e = e.Next() { w.Seri...
[ "func", "(", "w", "*", "Writer", ")", "WriteList", "(", "lst", "*", "list", ".", "List", ")", "{", "ptr", ":=", "unsafe", ".", "Pointer", "(", "lst", ")", "\n", "typ", ":=", "reflect", ".", "TypeOf", "(", "lst", ")", "\n", "if", "writeRef", "(", ...
// WriteList to the writer
[ "WriteList", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L252-L269
train
hprose/hprose-golang
io/writer.go
WriteTuple
func (w *Writer) WriteTuple(tuple ...interface{}) { setWriterRef(w, nil, nil) count := len(tuple) if count == 0 { writeEmptyList(w) return } writeListHeader(w, count) for _, v := range tuple { w.Serialize(v) } writeListFooter(w) }
go
func (w *Writer) WriteTuple(tuple ...interface{}) { setWriterRef(w, nil, nil) count := len(tuple) if count == 0 { writeEmptyList(w) return } writeListHeader(w, count) for _, v := range tuple { w.Serialize(v) } writeListFooter(w) }
[ "func", "(", "w", "*", "Writer", ")", "WriteTuple", "(", "tuple", "...", "interface", "{", "}", ")", "{", "setWriterRef", "(", "w", ",", "nil", ",", "nil", ")", "\n", "count", ":=", "len", "(", "tuple", ")", "\n", "if", "count", "==", "0", "{", ...
// WriteTuple to the writer
[ "WriteTuple", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L272-L284
train
hprose/hprose-golang
io/writer.go
WriteSlice
func (w *Writer) WriteSlice(slice []reflect.Value) { setWriterRef(w, nil, nil) count := len(slice) if count == 0 { writeEmptyList(w) return } writeListHeader(w, count) for i := range slice { w.WriteValue(slice[i]) } writeListFooter(w) }
go
func (w *Writer) WriteSlice(slice []reflect.Value) { setWriterRef(w, nil, nil) count := len(slice) if count == 0 { writeEmptyList(w) return } writeListHeader(w, count) for i := range slice { w.WriteValue(slice[i]) } writeListFooter(w) }
[ "func", "(", "w", "*", "Writer", ")", "WriteSlice", "(", "slice", "[", "]", "reflect", ".", "Value", ")", "{", "setWriterRef", "(", "w", ",", "nil", ",", "nil", ")", "\n", "count", ":=", "len", "(", "slice", ")", "\n", "if", "count", "==", "0", ...
// WriteSlice to the writer
[ "WriteSlice", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L287-L299
train
hprose/hprose-golang
io/writer.go
WriteStringSlice
func (w *Writer) WriteStringSlice(slice []string) { setWriterRef(w, nil, nil) count := len(slice) if count == 0 { writeEmptyList(w) return } writeListHeader(w, count) stringSliceEncoder(w, slice) writeListFooter(w) }
go
func (w *Writer) WriteStringSlice(slice []string) { setWriterRef(w, nil, nil) count := len(slice) if count == 0 { writeEmptyList(w) return } writeListHeader(w, count) stringSliceEncoder(w, slice) writeListFooter(w) }
[ "func", "(", "w", "*", "Writer", ")", "WriteStringSlice", "(", "slice", "[", "]", "string", ")", "{", "setWriterRef", "(", "w", ",", "nil", ",", "nil", ")", "\n", "count", ":=", "len", "(", "slice", ")", "\n", "if", "count", "==", "0", "{", "writ...
// WriteStringSlice to the writer
[ "WriteStringSlice", "to", "the", "writer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/writer.go#L302-L312
train
hprose/hprose-golang
rpc/tcp_server.go
NewTCPServer
func NewTCPServer(uri string) (server *TCPServer) { if uri == "" { uri = "tcp://127.0.0.1:0" } server = new(TCPServer) server.initTCPService() server.starter.server = server server.uri = uri return }
go
func NewTCPServer(uri string) (server *TCPServer) { if uri == "" { uri = "tcp://127.0.0.1:0" } server = new(TCPServer) server.initTCPService() server.starter.server = server server.uri = uri return }
[ "func", "NewTCPServer", "(", "uri", "string", ")", "(", "server", "*", "TCPServer", ")", "{", "if", "uri", "==", "\"", "\"", "{", "uri", "=", "\"", "\"", "\n", "}", "\n", "server", "=", "new", "(", "TCPServer", ")", "\n", "server", ".", "initTCPSer...
// NewTCPServer is the constructor for TCPServer
[ "NewTCPServer", "is", "the", "constructor", "for", "TCPServer" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/tcp_server.go#L36-L45
train
hprose/hprose-golang
rpc/tcp_server.go
Handle
func (server *TCPServer) Handle() (err error) { if server.listener != nil { return ErrServerIsAlreadyStarted } u, err := url.Parse(server.uri) if err != nil { return err } addr, err := net.ResolveTCPAddr(u.Scheme, u.Host) if err != nil { return err } if server.listener, err = net.ListenTCP(u.Scheme, addr...
go
func (server *TCPServer) Handle() (err error) { if server.listener != nil { return ErrServerIsAlreadyStarted } u, err := url.Parse(server.uri) if err != nil { return err } addr, err := net.ResolveTCPAddr(u.Scheme, u.Host) if err != nil { return err } if server.listener, err = net.ListenTCP(u.Scheme, addr...
[ "func", "(", "server", "*", "TCPServer", ")", "Handle", "(", ")", "(", "err", "error", ")", "{", "if", "server", ".", "listener", "!=", "nil", "{", "return", "ErrServerIsAlreadyStarted", "\n", "}", "\n", "u", ",", "err", ":=", "url", ".", "Parse", "(...
// Handle the hprose tcp server
[ "Handle", "the", "hprose", "tcp", "server" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/tcp_server.go#L60-L77
train
hprose/hprose-golang
rpc/tcp_server.go
Close
func (server *TCPServer) Close() { if server.listener != nil { listener := server.listener server.listener = nil listener.Close() } }
go
func (server *TCPServer) Close() { if server.listener != nil { listener := server.listener server.listener = nil listener.Close() } }
[ "func", "(", "server", "*", "TCPServer", ")", "Close", "(", ")", "{", "if", "server", ".", "listener", "!=", "nil", "{", "listener", ":=", "server", ".", "listener", "\n", "server", ".", "listener", "=", "nil", "\n", "listener", ".", "Close", "(", ")...
// Close the hprose tcp server
[ "Close", "the", "hprose", "tcp", "server" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/tcp_server.go#L80-L86
train
hprose/hprose-golang
rpc/base_service.go
DefaultFixArguments
func DefaultFixArguments(args []reflect.Value, context ServiceContext) { i := len(args) - 1 typ := args[i].Type() if typ == interfaceType || typ == contextType || typ == serviceContextType { args[i] = reflect.ValueOf(context) } }
go
func DefaultFixArguments(args []reflect.Value, context ServiceContext) { i := len(args) - 1 typ := args[i].Type() if typ == interfaceType || typ == contextType || typ == serviceContextType { args[i] = reflect.ValueOf(context) } }
[ "func", "DefaultFixArguments", "(", "args", "[", "]", "reflect", ".", "Value", ",", "context", "ServiceContext", ")", "{", "i", ":=", "len", "(", "args", ")", "-", "1", "\n", "typ", ":=", "args", "[", "i", "]", ".", "Type", "(", ")", "\n", "if", ...
// DefaultFixArguments is the default FixArguments function
[ "DefaultFixArguments", "is", "the", "default", "FixArguments", "function" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L51-L57
train
hprose/hprose-golang
rpc/base_service.go
InitBaseService
func (service *BaseService) InitBaseService() { service.initMethodManager() service.initHandlerManager() service.Timeout = 120 * time.Second service.Heartbeat = 3 * time.Second service.ErrorDelay = 10 * time.Second service.topics = make(map[string]*topic) service.AddFunction("#", util.UUIDv4, Options{Simple: tru...
go
func (service *BaseService) InitBaseService() { service.initMethodManager() service.initHandlerManager() service.Timeout = 120 * time.Second service.Heartbeat = 3 * time.Second service.ErrorDelay = 10 * time.Second service.topics = make(map[string]*topic) service.AddFunction("#", util.UUIDv4, Options{Simple: tru...
[ "func", "(", "service", "*", "BaseService", ")", "InitBaseService", "(", ")", "{", "service", ".", "initMethodManager", "(", ")", "\n", "service", ".", "initHandlerManager", "(", ")", "\n", "service", ".", "Timeout", "=", "120", "*", "time", ".", "Second",...
// InitBaseService initializes BaseService
[ "InitBaseService", "initializes", "BaseService" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L60-L81
train
hprose/hprose-golang
rpc/base_service.go
AddFunction
func (service *BaseService) AddFunction(name string, function interface{}, option ...Options) Service { service.methodManager.AddFunction(name, function, option...) return service }
go
func (service *BaseService) AddFunction(name string, function interface{}, option ...Options) Service { service.methodManager.AddFunction(name, function, option...) return service }
[ "func", "(", "service", "*", "BaseService", ")", "AddFunction", "(", "name", "string", ",", "function", "interface", "{", "}", ",", "option", "...", "Options", ")", "Service", "{", "service", ".", "methodManager", ".", "AddFunction", "(", "name", ",", "fun...
// AddFunction publish a func or bound method // name is the method name // function is a func or bound method // options includes Mode, Simple, Oneway and NameSpace
[ "AddFunction", "publish", "a", "func", "or", "bound", "method", "name", "is", "the", "method", "name", "function", "is", "a", "func", "or", "bound", "method", "options", "includes", "Mode", "Simple", "Oneway", "and", "NameSpace" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L87-L90
train
hprose/hprose-golang
rpc/base_service.go
SetUserData
func (service *BaseService) SetUserData( userdata map[string]interface{}) Service { service.UserData = userdata return service }
go
func (service *BaseService) SetUserData( userdata map[string]interface{}) Service { service.UserData = userdata return service }
[ "func", "(", "service", "*", "BaseService", ")", "SetUserData", "(", "userdata", "map", "[", "string", "]", "interface", "{", "}", ")", "Service", "{", "service", ".", "UserData", "=", "userdata", "\n", "return", "service", "\n", "}" ]
// SetUserData for service
[ "SetUserData", "for", "service" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L187-L191
train
hprose/hprose-golang
rpc/base_service.go
FireErrorEvent
func FireErrorEvent(event ServiceEvent, e error, context Context) (err error) { defer func() { if e := recover(); e != nil { err = NewPanicError(e) } }() err = e switch event := event.(type) { case sendErrorEvent: event.OnSendError(err, context) case sendErrorEvent2: err = event.OnSendError(err, contex...
go
func FireErrorEvent(event ServiceEvent, e error, context Context) (err error) { defer func() { if e := recover(); e != nil { err = NewPanicError(e) } }() err = e switch event := event.(type) { case sendErrorEvent: event.OnSendError(err, context) case sendErrorEvent2: err = event.OnSendError(err, contex...
[ "func", "FireErrorEvent", "(", "event", "ServiceEvent", ",", "e", "error", ",", "context", "Context", ")", "(", "err", "error", ")", "{", "defer", "func", "(", ")", "{", "if", "e", ":=", "recover", "(", ")", ";", "e", "!=", "nil", "{", "err", "=", ...
// FireErrorEvent fires the OnSendError
[ "FireErrorEvent", "fires", "the", "OnSendError" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L267-L281
train
hprose/hprose-golang
rpc/base_service.go
EndError
func (service *BaseService) EndError(err error, context Context) []byte { w := io.NewByteWriter(service.sendError(err, context)) w.WriteByte(io.TagEnd) return w.Bytes() }
go
func (service *BaseService) EndError(err error, context Context) []byte { w := io.NewByteWriter(service.sendError(err, context)) w.WriteByte(io.TagEnd) return w.Bytes() }
[ "func", "(", "service", "*", "BaseService", ")", "EndError", "(", "err", "error", ",", "context", "Context", ")", "[", "]", "byte", "{", "w", ":=", "io", ".", "NewByteWriter", "(", "service", ".", "sendError", "(", "err", ",", "context", ")", ")", "\...
// EndError return the error response with TagEnd
[ "EndError", "return", "the", "error", "response", "with", "TagEnd" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L331-L335
train
hprose/hprose-golang
rpc/base_service.go
DoFunctionList
func (service *BaseService) DoFunctionList(context ServiceContext) []byte { writer := io.NewWriter(true) writer.WriteByte(io.TagFunctions) writer.WriteStringSlice(service.MethodNames) writer.WriteByte(io.TagEnd) return writer.Bytes() }
go
func (service *BaseService) DoFunctionList(context ServiceContext) []byte { writer := io.NewWriter(true) writer.WriteByte(io.TagFunctions) writer.WriteStringSlice(service.MethodNames) writer.WriteByte(io.TagEnd) return writer.Bytes() }
[ "func", "(", "service", "*", "BaseService", ")", "DoFunctionList", "(", "context", "ServiceContext", ")", "[", "]", "byte", "{", "writer", ":=", "io", ".", "NewWriter", "(", "true", ")", "\n", "writer", ".", "WriteByte", "(", "io", ".", "TagFunctions", "...
// DoFunctionList returns the function list
[ "DoFunctionList", "returns", "the", "function", "list" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L481-L487
train
hprose/hprose-golang
rpc/base_service.go
Handle
func (service *BaseService) Handle(request []byte, context Context) []byte { if service.UserData != nil { for k, v := range service.UserData { context.SetInterface(k, v) } } response, err := service.beforeFilterHandler(request, context) if err != nil { return service.EndError(err, context) } return respo...
go
func (service *BaseService) Handle(request []byte, context Context) []byte { if service.UserData != nil { for k, v := range service.UserData { context.SetInterface(k, v) } } response, err := service.beforeFilterHandler(request, context) if err != nil { return service.EndError(err, context) } return respo...
[ "func", "(", "service", "*", "BaseService", ")", "Handle", "(", "request", "[", "]", "byte", ",", "context", "Context", ")", "[", "]", "byte", "{", "if", "service", ".", "UserData", "!=", "nil", "{", "for", "k", ",", "v", ":=", "range", "service", ...
// Handle the hprose request and return the hprose response
[ "Handle", "the", "hprose", "request", "and", "return", "the", "hprose", "response" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L529-L540
train
hprose/hprose-golang
rpc/base_service.go
Publish
func (service *BaseService) Publish( topic string, timeout time.Duration, heartbeat time.Duration) Service { if timeout <= 0 { timeout = service.Timeout } if heartbeat <= 0 { heartbeat = service.Heartbeat } t := newTopic(heartbeat) service.topicLock.Lock() service.topics[topic] = t service.topicLock.Unlo...
go
func (service *BaseService) Publish( topic string, timeout time.Duration, heartbeat time.Duration) Service { if timeout <= 0 { timeout = service.Timeout } if heartbeat <= 0 { heartbeat = service.Heartbeat } t := newTopic(heartbeat) service.topicLock.Lock() service.topics[topic] = t service.topicLock.Unlo...
[ "func", "(", "service", "*", "BaseService", ")", "Publish", "(", "topic", "string", ",", "timeout", "time", ".", "Duration", ",", "heartbeat", "time", ".", "Duration", ")", "Service", "{", "if", "timeout", "<=", "0", "{", "timeout", "=", "service", ".", ...
// Publish the hprose push topic
[ "Publish", "the", "hprose", "push", "topic" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L576-L616
train
hprose/hprose-golang
rpc/base_service.go
IDList
func (service *BaseService) IDList(topic string) []string { return service.getTopic(topic).idlist() }
go
func (service *BaseService) IDList(topic string) []string { return service.getTopic(topic).idlist() }
[ "func", "(", "service", "*", "BaseService", ")", "IDList", "(", "topic", "string", ")", "[", "]", "string", "{", "return", "service", ".", "getTopic", "(", "topic", ")", ".", "idlist", "(", ")", "\n", "}" ]
// IDList returns the push client id list
[ "IDList", "returns", "the", "push", "client", "id", "list" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L654-L656
train
hprose/hprose-golang
rpc/base_service.go
Exist
func (service *BaseService) Exist(topic string, id string) bool { return service.getTopic(topic).exist(id) }
go
func (service *BaseService) Exist(topic string, id string) bool { return service.getTopic(topic).exist(id) }
[ "func", "(", "service", "*", "BaseService", ")", "Exist", "(", "topic", "string", ",", "id", "string", ")", "bool", "{", "return", "service", ".", "getTopic", "(", "topic", ")", ".", "exist", "(", "id", ")", "\n", "}" ]
// Exist returns true if the client id exist.
[ "Exist", "returns", "true", "if", "the", "client", "id", "exist", "." ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L659-L661
train
hprose/hprose-golang
rpc/base_service.go
Push
func (service *BaseService) Push(topic string, result interface{}, id ...string) { t := service.getTopic(topic) n := len(id) if n == 0 { id = t.idlist() n = len(id) if n == 0 { return } } for i := 0; i < n; i++ { service.unicast(t, topic, id[i], result, nil) } }
go
func (service *BaseService) Push(topic string, result interface{}, id ...string) { t := service.getTopic(topic) n := len(id) if n == 0 { id = t.idlist() n = len(id) if n == 0 { return } } for i := 0; i < n; i++ { service.unicast(t, topic, id[i], result, nil) } }
[ "func", "(", "service", "*", "BaseService", ")", "Push", "(", "topic", "string", ",", "result", "interface", "{", "}", ",", "id", "...", "string", ")", "{", "t", ":=", "service", ".", "getTopic", "(", "topic", ")", "\n", "n", ":=", "len", "(", "id"...
// Push result to clients
[ "Push", "result", "to", "clients" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L664-L677
train
hprose/hprose-golang
rpc/base_service.go
Broadcast
func (service *BaseService) Broadcast( topic string, result interface{}, callback func([]string)) { service.Multicast(topic, service.IDList(topic), result, callback) }
go
func (service *BaseService) Broadcast( topic string, result interface{}, callback func([]string)) { service.Multicast(topic, service.IDList(topic), result, callback) }
[ "func", "(", "service", "*", "BaseService", ")", "Broadcast", "(", "topic", "string", ",", "result", "interface", "{", "}", ",", "callback", "func", "(", "[", "]", "string", ")", ")", "{", "service", ".", "Multicast", "(", "topic", ",", "service", ".",...
// Broadcast push result to all clients
[ "Broadcast", "push", "result", "to", "all", "clients" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L680-L683
train
hprose/hprose-golang
rpc/base_service.go
Multicast
func (service *BaseService) Multicast( topic string, ids []string, result interface{}, callback func([]string)) { t := service.getTopic(topic) m := 0 n := len(ids) if n == 0 { callback(nil) return } sid := make(chan string) go func() { sended := make([]string, 0, n) for id := range sid { sended = app...
go
func (service *BaseService) Multicast( topic string, ids []string, result interface{}, callback func([]string)) { t := service.getTopic(topic) m := 0 n := len(ids) if n == 0 { callback(nil) return } sid := make(chan string) go func() { sended := make([]string, 0, n) for id := range sid { sended = app...
[ "func", "(", "service", "*", "BaseService", ")", "Multicast", "(", "topic", "string", ",", "ids", "[", "]", "string", ",", "result", "interface", "{", "}", ",", "callback", "func", "(", "[", "]", "string", ")", ")", "{", "t", ":=", "service", ".", ...
// Multicast result to the specified clients
[ "Multicast", "result", "to", "the", "specified", "clients" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L686-L715
train
hprose/hprose-golang
rpc/base_service.go
Unicast
func (service *BaseService) Unicast( topic string, id string, result interface{}, callback func(bool)) { service.unicast(service.getTopic(topic), topic, id, result, callback) }
go
func (service *BaseService) Unicast( topic string, id string, result interface{}, callback func(bool)) { service.unicast(service.getTopic(topic), topic, id, result, callback) }
[ "func", "(", "service", "*", "BaseService", ")", "Unicast", "(", "topic", "string", ",", "id", "string", ",", "result", "interface", "{", "}", ",", "callback", "func", "(", "bool", ")", ")", "{", "service", ".", "unicast", "(", "service", ".", "getTopi...
// Unicast result to then specified client
[ "Unicast", "result", "to", "then", "specified", "client" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_service.go#L718-L721
train
hprose/hprose-golang
rpc/base_client.go
IsSubscribed
func (tm *topicManager) IsSubscribed(topic string) bool { tm.locker.RLock() defer tm.locker.RUnlock() return tm.allTopics[topic] != nil }
go
func (tm *topicManager) IsSubscribed(topic string) bool { tm.locker.RLock() defer tm.locker.RUnlock() return tm.allTopics[topic] != nil }
[ "func", "(", "tm", "*", "topicManager", ")", "IsSubscribed", "(", "topic", "string", ")", "bool", "{", "tm", ".", "locker", ".", "RLock", "(", ")", "\n", "defer", "tm", ".", "locker", ".", "RUnlock", "(", ")", "\n", "return", "tm", ".", "allTopics", ...
// IsSubscribed the topic
[ "IsSubscribed", "the", "topic" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L77-L81
train
hprose/hprose-golang
rpc/base_client.go
SubscribedList
func (tm *topicManager) SubscribedList() []string { tm.locker.RLock() list := make([]string, 0, len(tm.allTopics)) for name := range tm.allTopics { list = append(list, name) } tm.locker.RUnlock() return list }
go
func (tm *topicManager) SubscribedList() []string { tm.locker.RLock() list := make([]string, 0, len(tm.allTopics)) for name := range tm.allTopics { list = append(list, name) } tm.locker.RUnlock() return list }
[ "func", "(", "tm", "*", "topicManager", ")", "SubscribedList", "(", ")", "[", "]", "string", "{", "tm", ".", "locker", ".", "RLock", "(", ")", "\n", "list", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "tm", ".", "allTopics",...
// SubscribedList returns the subscribed topic list
[ "SubscribedList", "returns", "the", "subscribed", "topic", "list" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L84-L92
train
hprose/hprose-golang
rpc/base_client.go
InitBaseClient
func (client *BaseClient) InitBaseClient() { client.initHandlerManager() client.timeout = 30 * time.Second client.retry = 10 client.contextPool = sync.Pool{ New: func() interface{} { return new(ClientContext) }, } client.override.invokeHandler = func( name string, args []reflect.Value, context Context) (res...
go
func (client *BaseClient) InitBaseClient() { client.initHandlerManager() client.timeout = 30 * time.Second client.retry = 10 client.contextPool = sync.Pool{ New: func() interface{} { return new(ClientContext) }, } client.override.invokeHandler = func( name string, args []reflect.Value, context Context) (res...
[ "func", "(", "client", "*", "BaseClient", ")", "InitBaseClient", "(", ")", "{", "client", ".", "initHandlerManager", "(", ")", "\n", "client", ".", "timeout", "=", "30", "*", "time", ".", "Second", "\n", "client", ".", "retry", "=", "10", "\n", "client...
// InitBaseClient initializes BaseClient
[ "InitBaseClient", "initializes", "BaseClient" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L114-L135
train
hprose/hprose-golang
rpc/base_client.go
SetUserData
func (client *BaseClient) SetUserData( userdata map[string]interface{}) Client { client.UserData = userdata return client }
go
func (client *BaseClient) SetUserData( userdata map[string]interface{}) Client { client.UserData = userdata return client }
[ "func", "(", "client", "*", "BaseClient", ")", "SetUserData", "(", "userdata", "map", "[", "string", "]", "interface", "{", "}", ")", "Client", "{", "client", ".", "UserData", "=", "userdata", "\n", "return", "client", "\n", "}" ]
// SetUserData for client
[ "SetUserData", "for", "client" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L262-L266
train
hprose/hprose-golang
rpc/base_client.go
UseService
func (client *BaseClient) UseService( remoteService interface{}, namespace ...string) { ns := "" if len(namespace) == 1 { ns = namespace[0] } v := reflect.ValueOf(remoteService) if v.Kind() != reflect.Ptr { panic("UseService: remoteService argument must be a pointer") } client.buildRemoteService(v, ns) }
go
func (client *BaseClient) UseService( remoteService interface{}, namespace ...string) { ns := "" if len(namespace) == 1 { ns = namespace[0] } v := reflect.ValueOf(remoteService) if v.Kind() != reflect.Ptr { panic("UseService: remoteService argument must be a pointer") } client.buildRemoteService(v, ns) }
[ "func", "(", "client", "*", "BaseClient", ")", "UseService", "(", "remoteService", "interface", "{", "}", ",", "namespace", "...", "string", ")", "{", "ns", ":=", "\"", "\"", "\n", "if", "len", "(", "namespace", ")", "==", "1", "{", "ns", "=", "names...
// UseService build a remote service proxy object with namespace
[ "UseService", "build", "a", "remote", "service", "proxy", "object", "with", "namespace" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L269-L280
train
hprose/hprose-golang
rpc/base_client.go
GetClientContext
func (client *BaseClient) GetClientContext( settings *InvokeSettings) (context *ClientContext) { context = client.contextPool.Get().(*ClientContext) context.InitBaseContext() context.Client = client context.Retried = 0 if client.UserData != nil { for k, v := range client.UserData { context.SetInterface(k, v)...
go
func (client *BaseClient) GetClientContext( settings *InvokeSettings) (context *ClientContext) { context = client.contextPool.Get().(*ClientContext) context.InitBaseContext() context.Client = client context.Retried = 0 if client.UserData != nil { for k, v := range client.UserData { context.SetInterface(k, v)...
[ "func", "(", "client", "*", "BaseClient", ")", "GetClientContext", "(", "settings", "*", "InvokeSettings", ")", "(", "context", "*", "ClientContext", ")", "{", "context", "=", "client", ".", "contextPool", ".", "Get", "(", ")", ".", "(", "*", "ClientContex...
// GetClientContext return a ClientContext
[ "GetClientContext", "return", "a", "ClientContext" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L283-L314
train
hprose/hprose-golang
rpc/base_client.go
Invoke
func (client *BaseClient) Invoke( name string, args []reflect.Value, settings *InvokeSettings) (results []reflect.Value, err error) { context := client.GetClientContext(settings) results, err = client.handlerManager.invokeHandler(name, args, context) if results == nil && len(context.ResultTypes) > 0 { n := len(...
go
func (client *BaseClient) Invoke( name string, args []reflect.Value, settings *InvokeSettings) (results []reflect.Value, err error) { context := client.GetClientContext(settings) results, err = client.handlerManager.invokeHandler(name, args, context) if results == nil && len(context.ResultTypes) > 0 { n := len(...
[ "func", "(", "client", "*", "BaseClient", ")", "Invoke", "(", "name", "string", ",", "args", "[", "]", "reflect", ".", "Value", ",", "settings", "*", "InvokeSettings", ")", "(", "results", "[", "]", "reflect", ".", "Value", ",", "err", "error", ")", ...
// Invoke the remote method synchronous
[ "Invoke", "the", "remote", "method", "synchronous" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L317-L332
train
hprose/hprose-golang
rpc/base_client.go
Go
func (client *BaseClient) Go( name string, args []reflect.Value, settings *InvokeSettings, callback Callback) { go func() { defer client.fireErrorEvent(name, nil) callback(client.Invoke(name, args, settings)) }() }
go
func (client *BaseClient) Go( name string, args []reflect.Value, settings *InvokeSettings, callback Callback) { go func() { defer client.fireErrorEvent(name, nil) callback(client.Invoke(name, args, settings)) }() }
[ "func", "(", "client", "*", "BaseClient", ")", "Go", "(", "name", "string", ",", "args", "[", "]", "reflect", ".", "Value", ",", "settings", "*", "InvokeSettings", ",", "callback", "Callback", ")", "{", "go", "func", "(", ")", "{", "defer", "client", ...
// Go invoke the remote method asynchronous
[ "Go", "invoke", "the", "remote", "method", "asynchronous" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L335-L344
train
hprose/hprose-golang
rpc/base_client.go
AutoID
func (client *BaseClient) AutoID() (string, error) { client.topicManager.locker.RLock() if client.id != "" { client.topicManager.locker.RUnlock() return client.id, nil } client.topicManager.locker.RUnlock() client.topicManager.locker.Lock() defer client.topicManager.locker.Unlock() if client.id != "" { ret...
go
func (client *BaseClient) AutoID() (string, error) { client.topicManager.locker.RLock() if client.id != "" { client.topicManager.locker.RUnlock() return client.id, nil } client.topicManager.locker.RUnlock() client.topicManager.locker.Lock() defer client.topicManager.locker.Unlock() if client.id != "" { ret...
[ "func", "(", "client", "*", "BaseClient", ")", "AutoID", "(", ")", "(", "string", ",", "error", ")", "{", "client", ".", "topicManager", ".", "locker", ".", "RLock", "(", ")", "\n", "if", "client", ".", "id", "!=", "\"", "\"", "{", "client", ".", ...
// AutoID returns the auto id of this hprose client. // If the id is not initialized, it be initialized and returned.
[ "AutoID", "returns", "the", "auto", "id", "of", "this", "hprose", "client", ".", "If", "the", "id", "is", "not", "initialized", "it", "be", "initialized", "and", "returned", "." ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L813-L831
train
hprose/hprose-golang
rpc/base_client.go
Subscribe
func (client *BaseClient) Subscribe( name string, id string, settings *InvokeSettings, callback interface{}) (err error) { if id == "" { id, err = client.AutoID() if err != nil { return err } } f := reflect.ValueOf(callback) if f.Kind() != reflect.Func { return errors.New("Subscribe: callback must be a...
go
func (client *BaseClient) Subscribe( name string, id string, settings *InvokeSettings, callback interface{}) (err error) { if id == "" { id, err = client.AutoID() if err != nil { return err } } f := reflect.ValueOf(callback) if f.Kind() != reflect.Func { return errors.New("Subscribe: callback must be a...
[ "func", "(", "client", "*", "BaseClient", ")", "Subscribe", "(", "name", "string", ",", "id", "string", ",", "settings", "*", "InvokeSettings", ",", "callback", "interface", "{", "}", ")", "(", "err", "error", ")", "{", "if", "id", "==", "\"", "\"", ...
// Subscribe a push topic
[ "Subscribe", "a", "push", "topic" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L885-L930
train
hprose/hprose-golang
rpc/base_client.go
Unsubscribe
func (client *BaseClient) Unsubscribe(name string, id ...string) { client.topicManager.locker.Lock() if client.allTopics[name] != nil { if len(id) == 0 { if client.id == "" { delete(client.allTopics, name) } else { delete(client.allTopics[name], client.id) } } else { for i := range id { de...
go
func (client *BaseClient) Unsubscribe(name string, id ...string) { client.topicManager.locker.Lock() if client.allTopics[name] != nil { if len(id) == 0 { if client.id == "" { delete(client.allTopics, name) } else { delete(client.allTopics[name], client.id) } } else { for i := range id { de...
[ "func", "(", "client", "*", "BaseClient", ")", "Unsubscribe", "(", "name", "string", ",", "id", "...", "string", ")", "{", "client", ".", "topicManager", ".", "locker", ".", "Lock", "(", ")", "\n", "if", "client", ".", "allTopics", "[", "name", "]", ...
// Unsubscribe a push topic
[ "Unsubscribe", "a", "push", "topic" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/base_client.go#L933-L952
train
hprose/hprose-golang
rpc/tcp_client.go
NewTCPClient
func NewTCPClient(uri ...string) (client *TCPClient) { client = new(TCPClient) client.initSocketClient() client.Linger = -1 client.NoDelay = true client.KeepAlive = true client.setCreateConn(client.createTCPConn) client.SetURIList(uri) return }
go
func NewTCPClient(uri ...string) (client *TCPClient) { client = new(TCPClient) client.initSocketClient() client.Linger = -1 client.NoDelay = true client.KeepAlive = true client.setCreateConn(client.createTCPConn) client.SetURIList(uri) return }
[ "func", "NewTCPClient", "(", "uri", "...", "string", ")", "(", "client", "*", "TCPClient", ")", "{", "client", "=", "new", "(", "TCPClient", ")", "\n", "client", ".", "initSocketClient", "(", ")", "\n", "client", ".", "Linger", "=", "-", "1", "\n", "...
// NewTCPClient is the constructor of TCPClient
[ "NewTCPClient", "is", "the", "constructor", "of", "TCPClient" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/tcp_client.go#L39-L48
train
hprose/hprose-golang
rpc/server.go
Start
func (starter *starter) Start() (err error) { for { if err = starter.server.Handle(); err != nil { return err } starter.c = make(chan os.Signal, 1) signal.Notify(starter.c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT, syscall.SIGKILL) s := <-starter.c starter.server.Close() switch...
go
func (starter *starter) Start() (err error) { for { if err = starter.server.Handle(); err != nil { return err } starter.c = make(chan os.Signal, 1) signal.Notify(starter.c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT, syscall.SIGKILL) s := <-starter.c starter.server.Close() switch...
[ "func", "(", "starter", "*", "starter", ")", "Start", "(", ")", "(", "err", "error", ")", "{", "for", "{", "if", "err", "=", "starter", ".", "server", ".", "Handle", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "sta...
// Start the hprose server
[ "Start", "the", "hprose", "server" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/server.go#L45-L60
train
hprose/hprose-golang
io/reader_pool.go
ReleaseReader
func (pool *ReaderPool) ReleaseReader(reader *Reader) { reader.Init(nil) reader.Reset() pool.Put(reader) }
go
func (pool *ReaderPool) ReleaseReader(reader *Reader) { reader.Init(nil) reader.Reset() pool.Put(reader) }
[ "func", "(", "pool", "*", "ReaderPool", ")", "ReleaseReader", "(", "reader", "*", "Reader", ")", "{", "reader", ".", "Init", "(", "nil", ")", "\n", "reader", ".", "Reset", "(", ")", "\n", "pool", ".", "Put", "(", "reader", ")", "\n", "}" ]
// ReleaseReader to pool.
[ "ReleaseReader", "to", "pool", "." ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader_pool.go#L40-L44
train
hprose/hprose-golang
rpc/websocket/websocket_service.go
NewWebSocketService
func NewWebSocketService() (service *WebSocketService) { service = new(WebSocketService) service.InitHTTPService() service.contextPool = sync.Pool{ New: func() interface{} { return new(WebSocketContext) }, } service.FixArguments = websocketFixArguments service.CheckOrigin = func(request *http.Request) bool { ...
go
func NewWebSocketService() (service *WebSocketService) { service = new(WebSocketService) service.InitHTTPService() service.contextPool = sync.Pool{ New: func() interface{} { return new(WebSocketContext) }, } service.FixArguments = websocketFixArguments service.CheckOrigin = func(request *http.Request) bool { ...
[ "func", "NewWebSocketService", "(", ")", "(", "service", "*", "WebSocketService", ")", "{", "service", "=", "new", "(", "WebSocketService", ")", "\n", "service", ".", "InitHTTPService", "(", ")", "\n", "service", ".", "contextPool", "=", "sync", ".", "Pool",...
// NewWebSocketService is the constructor of WebSocketService
[ "NewWebSocketService", "is", "the", "constructor", "of", "WebSocketService" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/rpc/websocket/websocket_service.go#L76-L95
train
hprose/hprose-golang
io/reader.go
NewReader
func NewReader(buf []byte, simple bool) (reader *Reader) { reader = new(Reader) reader.buf = buf reader.Simple = simple return }
go
func NewReader(buf []byte, simple bool) (reader *Reader) { reader = new(Reader) reader.buf = buf reader.Simple = simple return }
[ "func", "NewReader", "(", "buf", "[", "]", "byte", ",", "simple", "bool", ")", "(", "reader", "*", "Reader", ")", "{", "reader", "=", "new", "(", "Reader", ")", "\n", "reader", ".", "buf", "=", "buf", "\n", "reader", ".", "Simple", "=", "simple", ...
// NewReader is the constructor for Hprose Reader
[ "NewReader", "is", "the", "constructor", "for", "Hprose", "Reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L44-L49
train
hprose/hprose-golang
io/reader.go
Unserialize
func (r *Reader) Unserialize(p interface{}) { v := reflect.ValueOf(p) if v.Kind() != reflect.Ptr { panic(errors.New("Unserialize: argument p must be a pointer")) } r.ReadValue(v.Elem()) }
go
func (r *Reader) Unserialize(p interface{}) { v := reflect.ValueOf(p) if v.Kind() != reflect.Ptr { panic(errors.New("Unserialize: argument p must be a pointer")) } r.ReadValue(v.Elem()) }
[ "func", "(", "r", "*", "Reader", ")", "Unserialize", "(", "p", "interface", "{", "}", ")", "{", "v", ":=", "reflect", ".", "ValueOf", "(", "p", ")", "\n", "if", "v", ".", "Kind", "(", ")", "!=", "reflect", ".", "Ptr", "{", "panic", "(", "errors...
// Unserialize a data from the reader
[ "Unserialize", "a", "data", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L52-L58
train
hprose/hprose-golang
io/reader.go
ReadValue
func (r *Reader) ReadValue(v reflect.Value) { tag := r.readByte() decoder := valueDecoders[v.Kind()] decoder(r, v, tag) }
go
func (r *Reader) ReadValue(v reflect.Value) { tag := r.readByte() decoder := valueDecoders[v.Kind()] decoder(r, v, tag) }
[ "func", "(", "r", "*", "Reader", ")", "ReadValue", "(", "v", "reflect", ".", "Value", ")", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "valueDecoders", "[", "v", ".", "Kind", "(", ")", "]", "\n", "decoder", "(", "r", ...
// ReadValue from the reader
[ "ReadValue", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L61-L65
train
hprose/hprose-golang
io/reader.go
CheckTag
func (r *Reader) CheckTag(expectTag byte) (tag byte) { tag = r.readByte() if tag != expectTag { unexpectedTag(tag, []byte{expectTag}) } return }
go
func (r *Reader) CheckTag(expectTag byte) (tag byte) { tag = r.readByte() if tag != expectTag { unexpectedTag(tag, []byte{expectTag}) } return }
[ "func", "(", "r", "*", "Reader", ")", "CheckTag", "(", "expectTag", "byte", ")", "(", "tag", "byte", ")", "{", "tag", "=", "r", ".", "readByte", "(", ")", "\n", "if", "tag", "!=", "expectTag", "{", "unexpectedTag", "(", "tag", ",", "[", "]", "byt...
// CheckTag the next byte in reader is the expected tag or not
[ "CheckTag", "the", "next", "byte", "in", "reader", "is", "the", "expected", "tag", "or", "not" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L68-L74
train
hprose/hprose-golang
io/reader.go
CheckTags
func (r *Reader) CheckTags(expectTags []byte) (tag byte) { tag = r.readByte() if bytes.IndexByte(expectTags, tag) == -1 { unexpectedTag(tag, expectTags) } return }
go
func (r *Reader) CheckTags(expectTags []byte) (tag byte) { tag = r.readByte() if bytes.IndexByte(expectTags, tag) == -1 { unexpectedTag(tag, expectTags) } return }
[ "func", "(", "r", "*", "Reader", ")", "CheckTags", "(", "expectTags", "[", "]", "byte", ")", "(", "tag", "byte", ")", "{", "tag", "=", "r", ".", "readByte", "(", ")", "\n", "if", "bytes", ".", "IndexByte", "(", "expectTags", ",", "tag", ")", "=="...
// CheckTags the next byte in reader in the expected tags
[ "CheckTags", "the", "next", "byte", "in", "reader", "in", "the", "expected", "tags" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L77-L83
train
hprose/hprose-golang
io/reader.go
ReadBool
func (r *Reader) ReadBool() bool { tag := r.readByte() decoder := boolDecoders[tag] if decoder == nil { castError(tag, "bool") } return decoder(r) }
go
func (r *Reader) ReadBool() bool { tag := r.readByte() decoder := boolDecoders[tag] if decoder == nil { castError(tag, "bool") } return decoder(r) }
[ "func", "(", "r", "*", "Reader", ")", "ReadBool", "(", ")", "bool", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "boolDecoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "castError", "(", "tag", ",", "...
// ReadBool from the reader
[ "ReadBool", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L86-L93
train
hprose/hprose-golang
io/reader.go
ReadInt
func (r *Reader) ReadInt() int64 { tag := r.readByte() decoder := intDecoders[tag] if decoder == nil { castError(tag, "int64") } return decoder(r) }
go
func (r *Reader) ReadInt() int64 { tag := r.readByte() decoder := intDecoders[tag] if decoder == nil { castError(tag, "int64") } return decoder(r) }
[ "func", "(", "r", "*", "Reader", ")", "ReadInt", "(", ")", "int64", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "intDecoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "castError", "(", "tag", ",", "\...
// ReadInt from the reader
[ "ReadInt", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L101-L108
train
hprose/hprose-golang
io/reader.go
ReadUint
func (r *Reader) ReadUint() uint64 { tag := r.readByte() decoder := uintDecoders[tag] if decoder == nil { castError(tag, "uint64") } return decoder(r) }
go
func (r *Reader) ReadUint() uint64 { tag := r.readByte() decoder := uintDecoders[tag] if decoder == nil { castError(tag, "uint64") } return decoder(r) }
[ "func", "(", "r", "*", "Reader", ")", "ReadUint", "(", ")", "uint64", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "uintDecoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "castError", "(", "tag", ",", ...
// ReadUint from the reader
[ "ReadUint", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L111-L118
train
hprose/hprose-golang
io/reader.go
ReadFloat32
func (r *Reader) ReadFloat32() float32 { tag := r.readByte() decoder := float32Decoders[tag] if decoder == nil { castError(tag, "float32") } return decoder(r) }
go
func (r *Reader) ReadFloat32() float32 { tag := r.readByte() decoder := float32Decoders[tag] if decoder == nil { castError(tag, "float32") } return decoder(r) }
[ "func", "(", "r", "*", "Reader", ")", "ReadFloat32", "(", ")", "float32", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "float32Decoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "castError", "(", "tag", ...
// ReadFloat32 from the reader
[ "ReadFloat32", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L121-L128
train
hprose/hprose-golang
io/reader.go
ReadFloat64
func (r *Reader) ReadFloat64() float64 { tag := r.readByte() decoder := float64Decoders[tag] if decoder == nil { castError(tag, "float64") } return decoder(r) }
go
func (r *Reader) ReadFloat64() float64 { tag := r.readByte() decoder := float64Decoders[tag] if decoder == nil { castError(tag, "float64") } return decoder(r) }
[ "func", "(", "r", "*", "Reader", ")", "ReadFloat64", "(", ")", "float64", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "float64Decoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "castError", "(", "tag", ...
// ReadFloat64 from the reader
[ "ReadFloat64", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L131-L138
train
hprose/hprose-golang
io/reader.go
ReadComplex64
func (r *Reader) ReadComplex64() complex64 { tag := r.readByte() decoder := complex64Decoders[tag] if decoder == nil { castError(tag, "complex64") } return decoder(r) }
go
func (r *Reader) ReadComplex64() complex64 { tag := r.readByte() decoder := complex64Decoders[tag] if decoder == nil { castError(tag, "complex64") } return decoder(r) }
[ "func", "(", "r", "*", "Reader", ")", "ReadComplex64", "(", ")", "complex64", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "complex64Decoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "castError", "(", "t...
// ReadComplex64 from the reader
[ "ReadComplex64", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L141-L148
train
hprose/hprose-golang
io/reader.go
ReadComplex128
func (r *Reader) ReadComplex128() complex128 { tag := r.readByte() decoder := complex128Decoders[tag] if decoder == nil { castError(tag, "complex128") } return decoder(r) }
go
func (r *Reader) ReadComplex128() complex128 { tag := r.readByte() decoder := complex128Decoders[tag] if decoder == nil { castError(tag, "complex128") } return decoder(r) }
[ "func", "(", "r", "*", "Reader", ")", "ReadComplex128", "(", ")", "complex128", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "complex128Decoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "castError", "(", ...
// ReadComplex128 from the reader
[ "ReadComplex128", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L151-L158
train
hprose/hprose-golang
io/reader.go
ReadStringWithoutTag
func (r *Reader) ReadStringWithoutTag() (str string) { str = r.readString() if !r.Simple { setReaderRef(r, str) } return str }
go
func (r *Reader) ReadStringWithoutTag() (str string) { str = r.readString() if !r.Simple { setReaderRef(r, str) } return str }
[ "func", "(", "r", "*", "Reader", ")", "ReadStringWithoutTag", "(", ")", "(", "str", "string", ")", "{", "str", "=", "r", ".", "readString", "(", ")", "\n", "if", "!", "r", ".", "Simple", "{", "setReaderRef", "(", "r", ",", "str", ")", "\n", "}", ...
// ReadStringWithoutTag from the reader
[ "ReadStringWithoutTag", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L161-L167
train
hprose/hprose-golang
io/reader.go
ReadString
func (r *Reader) ReadString() string { tag := r.readByte() decoder := stringDecoders[tag] if decoder == nil { castError(tag, "string") } return decoder(r) }
go
func (r *Reader) ReadString() string { tag := r.readByte() decoder := stringDecoders[tag] if decoder == nil { castError(tag, "string") } return decoder(r) }
[ "func", "(", "r", "*", "Reader", ")", "ReadString", "(", ")", "string", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "stringDecoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "castError", "(", "tag", ",...
// ReadString from the reader
[ "ReadString", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L170-L177
train
hprose/hprose-golang
io/reader.go
ReadBytesWithoutTag
func (r *Reader) ReadBytesWithoutTag() (b []byte) { l := r.readLength() b = make([]byte, l) if _, err := r.Read(b); err != nil { panic(err) } r.readByte() if !r.Simple { setReaderRef(r, b) } return }
go
func (r *Reader) ReadBytesWithoutTag() (b []byte) { l := r.readLength() b = make([]byte, l) if _, err := r.Read(b); err != nil { panic(err) } r.readByte() if !r.Simple { setReaderRef(r, b) } return }
[ "func", "(", "r", "*", "Reader", ")", "ReadBytesWithoutTag", "(", ")", "(", "b", "[", "]", "byte", ")", "{", "l", ":=", "r", ".", "readLength", "(", ")", "\n", "b", "=", "make", "(", "[", "]", "byte", ",", "l", ")", "\n", "if", "_", ",", "e...
// ReadBytesWithoutTag from the reader
[ "ReadBytesWithoutTag", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L180-L191
train
hprose/hprose-golang
io/reader.go
ReadBytes
func (r *Reader) ReadBytes() (b []byte) { tag := r.readByte() decoder := sliceDecoders[tag] if decoder == nil { castError(tag, "[]byte") } decoder(r, reflect.ValueOf(&b).Elem()) return }
go
func (r *Reader) ReadBytes() (b []byte) { tag := r.readByte() decoder := sliceDecoders[tag] if decoder == nil { castError(tag, "[]byte") } decoder(r, reflect.ValueOf(&b).Elem()) return }
[ "func", "(", "r", "*", "Reader", ")", "ReadBytes", "(", ")", "(", "b", "[", "]", "byte", ")", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "sliceDecoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil", "{", "c...
// ReadBytes from the reader
[ "ReadBytes", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L194-L202
train
hprose/hprose-golang
io/reader.go
ReadInterface
func (r *Reader) ReadInterface() (v interface{}) { tag := r.readByte() decoder := interfaceDecoders[tag] if decoder == nil { castError(tag, "interface{}") } decoder(r, reflect.ValueOf(&v).Elem()) return }
go
func (r *Reader) ReadInterface() (v interface{}) { tag := r.readByte() decoder := interfaceDecoders[tag] if decoder == nil { castError(tag, "interface{}") } decoder(r, reflect.ValueOf(&v).Elem()) return }
[ "func", "(", "r", "*", "Reader", ")", "ReadInterface", "(", ")", "(", "v", "interface", "{", "}", ")", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "decoder", ":=", "interfaceDecoders", "[", "tag", "]", "\n", "if", "decoder", "==", "nil"...
// ReadInterface from the reader
[ "ReadInterface", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L205-L213
train
hprose/hprose-golang
io/reader.go
ReadTime
func (r *Reader) ReadTime() time.Time { tag := r.readByte() switch tag { case TagDate: return r.ReadDateTimeWithoutTag() case TagTime: return r.ReadTimeWithoutTag() } castError(tag, "time.Time") return time.Time{} }
go
func (r *Reader) ReadTime() time.Time { tag := r.readByte() switch tag { case TagDate: return r.ReadDateTimeWithoutTag() case TagTime: return r.ReadTimeWithoutTag() } castError(tag, "time.Time") return time.Time{} }
[ "func", "(", "r", "*", "Reader", ")", "ReadTime", "(", ")", "time", ".", "Time", "{", "tag", ":=", "r", ".", "readByte", "(", ")", "\n", "switch", "tag", "{", "case", "TagDate", ":", "return", "r", ".", "ReadDateTimeWithoutTag", "(", ")", "\n", "ca...
// ReadTime from the reader
[ "ReadTime", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L216-L226
train
hprose/hprose-golang
io/reader.go
ReadDateTimeWithoutTag
func (r *Reader) ReadDateTimeWithoutTag() (dt time.Time) { year := r.read4Digit() month := r.read2Digit() day := r.read2Digit() tag := r.readByte() var hour, min, sec, nsec int if tag == TagTime { hour = r.read2Digit() min = r.read2Digit() sec = r.read2Digit() tag = r.readByte() if tag == TagPoint { ...
go
func (r *Reader) ReadDateTimeWithoutTag() (dt time.Time) { year := r.read4Digit() month := r.read2Digit() day := r.read2Digit() tag := r.readByte() var hour, min, sec, nsec int if tag == TagTime { hour = r.read2Digit() min = r.read2Digit() sec = r.read2Digit() tag = r.readByte() if tag == TagPoint { ...
[ "func", "(", "r", "*", "Reader", ")", "ReadDateTimeWithoutTag", "(", ")", "(", "dt", "time", ".", "Time", ")", "{", "year", ":=", "r", ".", "read4Digit", "(", ")", "\n", "month", ":=", "r", ".", "read2Digit", "(", ")", "\n", "day", ":=", "r", "."...
// ReadDateTimeWithoutTag from the reader
[ "ReadDateTimeWithoutTag", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L229-L255
train
hprose/hprose-golang
io/reader.go
ReadTimeWithoutTag
func (r *Reader) ReadTimeWithoutTag() (t time.Time) { hour := r.read2Digit() min := r.read2Digit() sec := r.read2Digit() tag := r.readByte() var nsec int if tag == TagPoint { nsec, tag = r.readNsec() } var loc *time.Location if tag == TagUTC { loc = time.UTC } else { loc = time.Local } t = time.Date(1...
go
func (r *Reader) ReadTimeWithoutTag() (t time.Time) { hour := r.read2Digit() min := r.read2Digit() sec := r.read2Digit() tag := r.readByte() var nsec int if tag == TagPoint { nsec, tag = r.readNsec() } var loc *time.Location if tag == TagUTC { loc = time.UTC } else { loc = time.Local } t = time.Date(1...
[ "func", "(", "r", "*", "Reader", ")", "ReadTimeWithoutTag", "(", ")", "(", "t", "time", ".", "Time", ")", "{", "hour", ":=", "r", ".", "read2Digit", "(", ")", "\n", "min", ":=", "r", ".", "read2Digit", "(", ")", "\n", "sec", ":=", "r", ".", "re...
// ReadTimeWithoutTag from the reader
[ "ReadTimeWithoutTag", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L258-L278
train
hprose/hprose-golang
io/reader.go
ReadBigIntWithoutTag
func (r *Reader) ReadBigIntWithoutTag() *big.Int { b := r.readUntil(TagSemicolon) i, _ := new(big.Int).SetString(util.ByteString(b), 10) return i }
go
func (r *Reader) ReadBigIntWithoutTag() *big.Int { b := r.readUntil(TagSemicolon) i, _ := new(big.Int).SetString(util.ByteString(b), 10) return i }
[ "func", "(", "r", "*", "Reader", ")", "ReadBigIntWithoutTag", "(", ")", "*", "big", ".", "Int", "{", "b", ":=", "r", ".", "readUntil", "(", "TagSemicolon", ")", "\n", "i", ",", "_", ":=", "new", "(", "big", ".", "Int", ")", ".", "SetString", "(",...
// ReadBigIntWithoutTag from the reader
[ "ReadBigIntWithoutTag", "from", "the", "reader" ]
6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74
https://github.com/hprose/hprose-golang/blob/6c2a3b7138ea2c7dc4a8907d644f9f134e0fae74/io/reader.go#L281-L285
train