id
int32
0
167k
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
151,800
cgrates/ltcache
transcache.go
Get
func (tc *TransCache) Get(chID, itmID string) (interface{}, bool) { tc.cacheMux.RLock() defer tc.cacheMux.RUnlock() return tc.cacheInstance(chID).Get(itmID) }
go
func (tc *TransCache) Get(chID, itmID string) (interface{}, bool) { tc.cacheMux.RLock() defer tc.cacheMux.RUnlock() return tc.cacheInstance(chID).Get(itmID) }
[ "func", "(", "tc", "*", "TransCache", ")", "Get", "(", "chID", ",", "itmID", "string", ")", "(", "interface", "{", "}", ",", "bool", ")", "{", "tc", ".", "cacheMux", ".", "RLock", "(", ")", "\n", "defer", "tc", ".", "cacheMux", ".", "RUnlock", "(...
//Get returns the value of an Item
[ "Get", "returns", "the", "value", "of", "an", "Item" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L140-L144
151,801
cgrates/ltcache
transcache.go
Remove
func (tc *TransCache) Remove(chID, itmID string, commit bool, transID string) { if commit { if transID == "" { // Lock per operation not transaction tc.cacheMux.Lock() defer tc.cacheMux.Unlock() } tc.cacheInstance(chID).Remove(itmID) } else { tc.transBufMux.Lock() tc.transactionBuffer[transID] = append(tc.transactionBuffer[transID], &transactionItem{cacheID: chID, verb: RemoveItem, itemID: itmID}) tc.transBufMux.Unlock() } }
go
func (tc *TransCache) Remove(chID, itmID string, commit bool, transID string) { if commit { if transID == "" { // Lock per operation not transaction tc.cacheMux.Lock() defer tc.cacheMux.Unlock() } tc.cacheInstance(chID).Remove(itmID) } else { tc.transBufMux.Lock() tc.transactionBuffer[transID] = append(tc.transactionBuffer[transID], &transactionItem{cacheID: chID, verb: RemoveItem, itemID: itmID}) tc.transBufMux.Unlock() } }
[ "func", "(", "tc", "*", "TransCache", ")", "Remove", "(", "chID", ",", "itmID", "string", ",", "commit", "bool", ",", "transID", "string", ")", "{", "if", "commit", "{", "if", "transID", "==", "\"", "\"", "{", "// Lock per operation not transaction", "tc",...
// RempveItem removes an item from the cache
[ "RempveItem", "removes", "an", "item", "from", "the", "cache" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L166-L179
151,802
cgrates/ltcache
transcache.go
RemoveGroup
func (tc *TransCache) RemoveGroup(chID, grpID string, commit bool, transID string) { if commit { if transID == "" { // Lock locally tc.cacheMux.Lock() defer tc.cacheMux.Unlock() } tc.cacheInstance(chID).RemoveGroup(grpID) } else { tc.transBufMux.Lock() tc.transactionBuffer[transID] = append(tc.transactionBuffer[transID], &transactionItem{cacheID: chID, verb: RemoveGroup, groupIDs: []string{grpID}}) tc.transBufMux.Unlock() } }
go
func (tc *TransCache) RemoveGroup(chID, grpID string, commit bool, transID string) { if commit { if transID == "" { // Lock locally tc.cacheMux.Lock() defer tc.cacheMux.Unlock() } tc.cacheInstance(chID).RemoveGroup(grpID) } else { tc.transBufMux.Lock() tc.transactionBuffer[transID] = append(tc.transactionBuffer[transID], &transactionItem{cacheID: chID, verb: RemoveGroup, groupIDs: []string{grpID}}) tc.transBufMux.Unlock() } }
[ "func", "(", "tc", "*", "TransCache", ")", "RemoveGroup", "(", "chID", ",", "grpID", "string", ",", "commit", "bool", ",", "transID", "string", ")", "{", "if", "commit", "{", "if", "transID", "==", "\"", "\"", "{", "// Lock locally", "tc", ".", "cacheM...
// RemoveGroup removes a group of items out of cache
[ "RemoveGroup", "removes", "a", "group", "of", "items", "out", "of", "cache" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L205-L218
151,803
cgrates/ltcache
transcache.go
Clear
func (tc *TransCache) Clear(chIDs []string) { tc.cacheMux.Lock() if chIDs == nil { chIDs = make([]string, len(tc.cache)) i := 0 for chID := range tc.cache { chIDs[i] = chID i += 1 } } for _, chID := range chIDs { tc.cacheInstance(chID).Clear() } tc.cacheMux.Unlock() }
go
func (tc *TransCache) Clear(chIDs []string) { tc.cacheMux.Lock() if chIDs == nil { chIDs = make([]string, len(tc.cache)) i := 0 for chID := range tc.cache { chIDs[i] = chID i += 1 } } for _, chID := range chIDs { tc.cacheInstance(chID).Clear() } tc.cacheMux.Unlock() }
[ "func", "(", "tc", "*", "TransCache", ")", "Clear", "(", "chIDs", "[", "]", "string", ")", "{", "tc", ".", "cacheMux", ".", "Lock", "(", ")", "\n", "if", "chIDs", "==", "nil", "{", "chIDs", "=", "make", "(", "[", "]", "string", ",", "len", "(",...
// Remove all items in one or more cache instances
[ "Remove", "all", "items", "in", "one", "or", "more", "cache", "instances" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L221-L235
151,804
cgrates/ltcache
transcache.go
GetCloned
func (tc *TransCache) GetCloned(chID, itmID string) (cln interface{}, err error) { tc.cacheMux.RLock() origVal, hasIt := tc.cacheInstance(chID).Get(itmID) tc.cacheMux.RUnlock() if !hasIt { return nil, ErrNotFound } if origVal == nil { return } if _, canClone := origVal.(Cloner); !canClone { return nil, ErrNotClonable } retVals := reflect.ValueOf(origVal).MethodByName("Clone").Call(nil) // Call Clone method on the object errIf := retVals[1].Interface() var notNil bool if err, notNil = errIf.(error); notNil { return } return retVals[0].Interface(), nil }
go
func (tc *TransCache) GetCloned(chID, itmID string) (cln interface{}, err error) { tc.cacheMux.RLock() origVal, hasIt := tc.cacheInstance(chID).Get(itmID) tc.cacheMux.RUnlock() if !hasIt { return nil, ErrNotFound } if origVal == nil { return } if _, canClone := origVal.(Cloner); !canClone { return nil, ErrNotClonable } retVals := reflect.ValueOf(origVal).MethodByName("Clone").Call(nil) // Call Clone method on the object errIf := retVals[1].Interface() var notNil bool if err, notNil = errIf.(error); notNil { return } return retVals[0].Interface(), nil }
[ "func", "(", "tc", "*", "TransCache", ")", "GetCloned", "(", "chID", ",", "itmID", "string", ")", "(", "cln", "interface", "{", "}", ",", "err", "error", ")", "{", "tc", ".", "cacheMux", ".", "RLock", "(", ")", "\n", "origVal", ",", "hasIt", ":=", ...
// GetCloned returns a clone of an Item if Item is clonable
[ "GetCloned", "returns", "a", "clone", "of", "an", "Item", "if", "Item", "is", "clonable" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L238-L258
151,805
cgrates/ltcache
transcache.go
GetItemIDs
func (tc *TransCache) GetItemIDs(chID, prfx string) (itmIDs []string) { tc.cacheMux.RLock() itmIDs = tc.cacheInstance(chID).GetItemIDs(prfx) tc.cacheMux.RUnlock() return }
go
func (tc *TransCache) GetItemIDs(chID, prfx string) (itmIDs []string) { tc.cacheMux.RLock() itmIDs = tc.cacheInstance(chID).GetItemIDs(prfx) tc.cacheMux.RUnlock() return }
[ "func", "(", "tc", "*", "TransCache", ")", "GetItemIDs", "(", "chID", ",", "prfx", "string", ")", "(", "itmIDs", "[", "]", "string", ")", "{", "tc", ".", "cacheMux", ".", "RLock", "(", ")", "\n", "itmIDs", "=", "tc", ".", "cacheInstance", "(", "chI...
// GetItemIDs returns a list of item IDs matching prefix
[ "GetItemIDs", "returns", "a", "list", "of", "item", "IDs", "matching", "prefix" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L261-L266
151,806
cgrates/ltcache
transcache.go
GetItemExpiryTime
func (tc *TransCache) GetItemExpiryTime(chID, itmID string) (exp time.Time, ok bool) { tc.cacheMux.RLock() defer tc.cacheMux.RUnlock() return tc.cacheInstance(chID).GetItemExpiryTime(itmID) }
go
func (tc *TransCache) GetItemExpiryTime(chID, itmID string) (exp time.Time, ok bool) { tc.cacheMux.RLock() defer tc.cacheMux.RUnlock() return tc.cacheInstance(chID).GetItemExpiryTime(itmID) }
[ "func", "(", "tc", "*", "TransCache", ")", "GetItemExpiryTime", "(", "chID", ",", "itmID", "string", ")", "(", "exp", "time", ".", "Time", ",", "ok", "bool", ")", "{", "tc", ".", "cacheMux", ".", "RLock", "(", ")", "\n", "defer", "tc", ".", "cacheM...
// GetItemExpiryTime returns the expiry time of an item, ok is false if not found
[ "GetItemExpiryTime", "returns", "the", "expiry", "time", "of", "an", "item", "ok", "is", "false", "if", "not", "found" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L269-L273
151,807
cgrates/ltcache
transcache.go
HasItem
func (tc *TransCache) HasItem(chID, itmID string) (has bool) { tc.cacheMux.RLock() has = tc.cacheInstance(chID).HasItem(itmID) tc.cacheMux.RUnlock() return }
go
func (tc *TransCache) HasItem(chID, itmID string) (has bool) { tc.cacheMux.RLock() has = tc.cacheInstance(chID).HasItem(itmID) tc.cacheMux.RUnlock() return }
[ "func", "(", "tc", "*", "TransCache", ")", "HasItem", "(", "chID", ",", "itmID", "string", ")", "(", "has", "bool", ")", "{", "tc", ".", "cacheMux", ".", "RLock", "(", ")", "\n", "has", "=", "tc", ".", "cacheInstance", "(", "chID", ")", ".", "Has...
// HasItem verifies if Item is in the cache
[ "HasItem", "verifies", "if", "Item", "is", "in", "the", "cache" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L276-L281
151,808
cgrates/ltcache
transcache.go
GetCacheStats
func (tc *TransCache) GetCacheStats(chIDs []string) (cs map[string]*CacheStats) { cs = make(map[string]*CacheStats) tc.cacheMux.RLock() if len(chIDs) == 0 { for chID := range tc.cache { chIDs = append(chIDs, chID) } } for _, chID := range chIDs { cs[chID] = tc.cacheInstance(chID).GetCacheStats() } tc.cacheMux.RUnlock() return }
go
func (tc *TransCache) GetCacheStats(chIDs []string) (cs map[string]*CacheStats) { cs = make(map[string]*CacheStats) tc.cacheMux.RLock() if len(chIDs) == 0 { for chID := range tc.cache { chIDs = append(chIDs, chID) } } for _, chID := range chIDs { cs[chID] = tc.cacheInstance(chID).GetCacheStats() } tc.cacheMux.RUnlock() return }
[ "func", "(", "tc", "*", "TransCache", ")", "GetCacheStats", "(", "chIDs", "[", "]", "string", ")", "(", "cs", "map", "[", "string", "]", "*", "CacheStats", ")", "{", "cs", "=", "make", "(", "map", "[", "string", "]", "*", "CacheStats", ")", "\n", ...
// GetCacheStats returns on overview of full cache
[ "GetCacheStats", "returns", "on", "overview", "of", "full", "cache" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/transcache.go#L284-L297
151,809
ulule/gostorages
s3.go
Auth
func (s *S3Storage) Auth() (auth aws.Auth, err error) { return aws.GetAuth(s.AccessKeyId, s.SecretAccessKey) }
go
func (s *S3Storage) Auth() (auth aws.Auth, err error) { return aws.GetAuth(s.AccessKeyId, s.SecretAccessKey) }
[ "func", "(", "s", "*", "S3Storage", ")", "Auth", "(", ")", "(", "auth", "aws", ".", "Auth", ",", "err", "error", ")", "{", "return", "aws", ".", "GetAuth", "(", "s", ".", "AccessKeyId", ",", "s", ".", "SecretAccessKey", ")", "\n", "}" ]
// Auth returns a Auth instance
[ "Auth", "returns", "a", "Auth", "instance" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/s3.go#L61-L63
151,810
ulule/gostorages
s3.go
Client
func (s *S3Storage) Client() (*s3.S3, error) { auth, err := s.Auth() if err != nil { return nil, err } return s3.New(auth, s.Region), nil }
go
func (s *S3Storage) Client() (*s3.S3, error) { auth, err := s.Auth() if err != nil { return nil, err } return s3.New(auth, s.Region), nil }
[ "func", "(", "s", "*", "S3Storage", ")", "Client", "(", ")", "(", "*", "s3", ".", "S3", ",", "error", ")", "{", "auth", ",", "err", ":=", "s", ".", "Auth", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", ...
// Client returns a S3 instance
[ "Client", "returns", "a", "S3", "instance" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/s3.go#L66-L74
151,811
ulule/gostorages
s3.go
Bucket
func (s *S3Storage) Bucket() (*s3.Bucket, error) { client, err := s.Client() if err != nil { return nil, err } return client.Bucket(s.BucketName), nil }
go
func (s *S3Storage) Bucket() (*s3.Bucket, error) { client, err := s.Client() if err != nil { return nil, err } return client.Bucket(s.BucketName), nil }
[ "func", "(", "s", "*", "S3Storage", ")", "Bucket", "(", ")", "(", "*", "s3", ".", "Bucket", ",", "error", ")", "{", "client", ",", "err", ":=", "s", ".", "Client", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", ...
// Bucket returns a bucket instance
[ "Bucket", "returns", "a", "bucket", "instance" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/s3.go#L77-L85
151,812
ulule/gostorages
s3.go
Open
func (s *S3Storage) Open(filepath string) (File, error) { bucket, err := s.Bucket() if err != nil { return nil, err } key, err := s.Key(filepath) if err != nil { return nil, err } body, err := bucket.GetReader(s.Path(filepath)) if err != nil { return nil, err } return &S3StorageFile{ body, key, s, }, nil }
go
func (s *S3Storage) Open(filepath string) (File, error) { bucket, err := s.Bucket() if err != nil { return nil, err } key, err := s.Key(filepath) if err != nil { return nil, err } body, err := bucket.GetReader(s.Path(filepath)) if err != nil { return nil, err } return &S3StorageFile{ body, key, s, }, nil }
[ "func", "(", "s", "*", "S3Storage", ")", "Open", "(", "filepath", "string", ")", "(", "File", ",", "error", ")", "{", "bucket", ",", "err", ":=", "s", ".", "Bucket", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", ...
// Open returns the file content in a dedicated bucket
[ "Open", "returns", "the", "file", "content", "in", "a", "dedicated", "bucket" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/s3.go#L88-L112
151,813
ulule/gostorages
s3.go
Delete
func (s *S3Storage) Delete(filepath string) error { bucket, err := s.Bucket() if err != nil { return err } return bucket.Del(s.Path(filepath)) }
go
func (s *S3Storage) Delete(filepath string) error { bucket, err := s.Bucket() if err != nil { return err } return bucket.Del(s.Path(filepath)) }
[ "func", "(", "s", "*", "S3Storage", ")", "Delete", "(", "filepath", "string", ")", "error", "{", "bucket", ",", "err", ":=", "s", ".", "Bucket", "(", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "bucket"...
// Delete the file from the bucket
[ "Delete", "the", "file", "from", "the", "bucket" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/s3.go#L115-L123
151,814
ulule/gostorages
s3.go
Exists
func (s *S3Storage) Exists(filepath string) bool { _, err := s.Key(filepath) if err != nil { return false } return true }
go
func (s *S3Storage) Exists(filepath string) bool { _, err := s.Key(filepath) if err != nil { return false } return true }
[ "func", "(", "s", "*", "S3Storage", ")", "Exists", "(", "filepath", "string", ")", "bool", "{", "_", ",", "err", ":=", "s", ".", "Key", "(", "filepath", ")", "\n\n", "if", "err", "!=", "nil", "{", "return", "false", "\n", "}", "\n\n", "return", "...
// Exists checks if the given file is in the bucket
[ "Exists", "checks", "if", "the", "given", "file", "is", "in", "the", "bucket" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/s3.go#L142-L150
151,815
ulule/gostorages
s3.go
IsNotExist
func (s *S3Storage) IsNotExist(err error) bool { thr, ok := err.(*s3.Error) if !ok { return false } return thr.StatusCode == 404 }
go
func (s *S3Storage) IsNotExist(err error) bool { thr, ok := err.(*s3.Error) if !ok { return false } return thr.StatusCode == 404 }
[ "func", "(", "s", "*", "S3Storage", ")", "IsNotExist", "(", "err", "error", ")", "bool", "{", "thr", ",", "ok", ":=", "err", ".", "(", "*", "s3", ".", "Error", ")", "\n", "if", "!", "ok", "{", "return", "false", "\n", "}", "\n", "return", "thr"...
// IsNotExist returns a boolean indicating whether the error is known // to report that a file or directory does not exist.
[ "IsNotExist", "returns", "a", "boolean", "indicating", "whether", "the", "error", "is", "known", "to", "report", "that", "a", "file", "or", "directory", "does", "not", "exist", "." ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/s3.go#L200-L206
151,816
coreos/updateservicectl
instance.go
Loop
func (c *Client) Loop(n, m int) { for { randSleep(n, m) resp, err := c.MakeRequest("3", "2", true, false) if err != nil { log.Println(err) continue } c.SetVersion(resp) } }
go
func (c *Client) Loop(n, m int) { for { randSleep(n, m) resp, err := c.MakeRequest("3", "2", true, false) if err != nil { log.Println(err) continue } c.SetVersion(resp) } }
[ "func", "(", "c", "*", "Client", ")", "Loop", "(", "n", ",", "m", "int", ")", "{", "for", "{", "randSleep", "(", "n", ",", "m", ")", "\n\n", "resp", ",", "err", ":=", "c", ".", "MakeRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "true", "...
// Sleep between n and m seconds
[ "Sleep", "between", "n", "and", "m", "seconds" ]
cf2a962b5a44760365788ce8621a7057be7d6cc2
https://github.com/coreos/updateservicectl/blob/cf2a962b5a44760365788ce8621a7057be7d6cc2/instance.go#L308-L319
151,817
coreos/updateservicectl
instance.go
randSleep
func randSleep(n, m int) { r := m if m-n > 0 { r = rand.Intn(m-n) + n } time.Sleep(time.Duration(r) * time.Second) }
go
func randSleep(n, m int) { r := m if m-n > 0 { r = rand.Intn(m-n) + n } time.Sleep(time.Duration(r) * time.Second) }
[ "func", "randSleep", "(", "n", ",", "m", "int", ")", "{", "r", ":=", "m", "\n", "if", "m", "-", "n", ">", "0", "{", "r", "=", "rand", ".", "Intn", "(", "m", "-", "n", ")", "+", "n", "\n", "}", "\n", "time", ".", "Sleep", "(", "time", "....
// Sleeps randomly between n and m seconds.
[ "Sleeps", "randomly", "between", "n", "and", "m", "seconds", "." ]
cf2a962b5a44760365788ce8621a7057be7d6cc2
https://github.com/coreos/updateservicectl/blob/cf2a962b5a44760365788ce8621a7057be7d6cc2/instance.go#L322-L328
151,818
coreos/updateservicectl
cmd.go
findCommand
func findCommand(search string, args []string, commands []*Command) (cmd *Command, name string) { if len(args) < 1 { return } if search == "" { search = args[0] } else { search = fmt.Sprintf("%s %s", search, args[0]) } name = search for _, c := range commands { if c.Name == search { cmd = c // Clear the usage on flags as we will be printing our own // usage after parsing arguments c.Flags.Usage = func() {} if errHelp := c.Flags.Parse(args[1:]); errHelp != nil { printCommandUsage(cmd) os.Exit(ERROR_USAGE) } if len(cmd.Subcommands) != 0 { subArgs := cmd.Flags.Args() var subCmd *Command subCmd, name = findCommand(search, subArgs, cmd.Subcommands) if subCmd != nil { cmd = subCmd } } break } } return }
go
func findCommand(search string, args []string, commands []*Command) (cmd *Command, name string) { if len(args) < 1 { return } if search == "" { search = args[0] } else { search = fmt.Sprintf("%s %s", search, args[0]) } name = search for _, c := range commands { if c.Name == search { cmd = c // Clear the usage on flags as we will be printing our own // usage after parsing arguments c.Flags.Usage = func() {} if errHelp := c.Flags.Parse(args[1:]); errHelp != nil { printCommandUsage(cmd) os.Exit(ERROR_USAGE) } if len(cmd.Subcommands) != 0 { subArgs := cmd.Flags.Args() var subCmd *Command subCmd, name = findCommand(search, subArgs, cmd.Subcommands) if subCmd != nil { cmd = subCmd } } break } } return }
[ "func", "findCommand", "(", "search", "string", ",", "args", "[", "]", "string", ",", "commands", "[", "]", "*", "Command", ")", "(", "cmd", "*", "Command", ",", "name", "string", ")", "{", "if", "len", "(", "args", ")", "<", "1", "{", "return", ...
// determine which Command should be run
[ "determine", "which", "Command", "should", "be", "run" ]
cf2a962b5a44760365788ce8621a7057be7d6cc2
https://github.com/coreos/updateservicectl/blob/cf2a962b5a44760365788ce8621a7057be7d6cc2/cmd.go#L166-L198
151,819
ulule/gostorages
fs.go
NewFileSystemStorage
func NewFileSystemStorage(location string, baseURL string) Storage { return &FileSystemStorage{ &BaseStorage{ Location: location, BaseURL: baseURL, }, } }
go
func NewFileSystemStorage(location string, baseURL string) Storage { return &FileSystemStorage{ &BaseStorage{ Location: location, BaseURL: baseURL, }, } }
[ "func", "NewFileSystemStorage", "(", "location", "string", ",", "baseURL", "string", ")", "Storage", "{", "return", "&", "FileSystemStorage", "{", "&", "BaseStorage", "{", "Location", ":", "location", ",", "BaseURL", ":", "baseURL", ",", "}", ",", "}", "\n",...
// NewStorage returns a file system storage engine
[ "NewStorage", "returns", "a", "file", "system", "storage", "engine" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/fs.go#L24-L31
151,820
ulule/gostorages
fs.go
Save
func (s *FileSystemStorage) Save(filepath string, file File) error { return s.SaveWithPermissions(filepath, file, DefaultFilePermissions) }
go
func (s *FileSystemStorage) Save(filepath string, file File) error { return s.SaveWithPermissions(filepath, file, DefaultFilePermissions) }
[ "func", "(", "s", "*", "FileSystemStorage", ")", "Save", "(", "filepath", "string", ",", "file", "File", ")", "error", "{", "return", "s", ".", "SaveWithPermissions", "(", "filepath", ",", "file", ",", "DefaultFilePermissions", ")", "\n", "}" ]
// Save saves a file at the given path
[ "Save", "saves", "a", "file", "at", "the", "given", "path" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/fs.go#L64-L66
151,821
ulule/gostorages
fs.go
SaveWithPermissions
func (s *FileSystemStorage) SaveWithPermissions(filepath string, file File, perm os.FileMode) error { _, err := os.Stat(s.Location) if err != nil { return err } location := s.Path(filepath) basename := location[:strings.LastIndex(location, "/")+1] err = os.MkdirAll(basename, perm) if err != nil { return err } content, err := file.ReadAll() if err != nil { return err } err = ioutil.WriteFile(location, content, perm) return err }
go
func (s *FileSystemStorage) SaveWithPermissions(filepath string, file File, perm os.FileMode) error { _, err := os.Stat(s.Location) if err != nil { return err } location := s.Path(filepath) basename := location[:strings.LastIndex(location, "/")+1] err = os.MkdirAll(basename, perm) if err != nil { return err } content, err := file.ReadAll() if err != nil { return err } err = ioutil.WriteFile(location, content, perm) return err }
[ "func", "(", "s", "*", "FileSystemStorage", ")", "SaveWithPermissions", "(", "filepath", "string", ",", "file", "File", ",", "perm", "os", ".", "FileMode", ")", "error", "{", "_", ",", "err", ":=", "os", ".", "Stat", "(", "s", ".", "Location", ")", "...
// SaveWithPermissions saves a file with the given permissions to the storage
[ "SaveWithPermissions", "saves", "a", "file", "with", "the", "given", "permissions", "to", "the", "storage" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/fs.go#L69-L95
151,822
ulule/gostorages
fs.go
Open
func (s *FileSystemStorage) Open(filepath string) (File, error) { file, err := os.Open(s.Path(filepath)) if err != nil { return nil, err } return NewFileSystemFile(s, file) }
go
func (s *FileSystemStorage) Open(filepath string) (File, error) { file, err := os.Open(s.Path(filepath)) if err != nil { return nil, err } return NewFileSystemFile(s, file) }
[ "func", "(", "s", "*", "FileSystemStorage", ")", "Open", "(", "filepath", "string", ")", "(", "File", ",", "error", ")", "{", "file", ",", "err", ":=", "os", ".", "Open", "(", "s", ".", "Path", "(", "filepath", ")", ")", "\n\n", "if", "err", "!="...
// Open returns the file content
[ "Open", "returns", "the", "file", "content" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/fs.go#L98-L106
151,823
ulule/gostorages
fs.go
Delete
func (s *FileSystemStorage) Delete(filepath string) error { return os.Remove(s.Path(filepath)) }
go
func (s *FileSystemStorage) Delete(filepath string) error { return os.Remove(s.Path(filepath)) }
[ "func", "(", "s", "*", "FileSystemStorage", ")", "Delete", "(", "filepath", "string", ")", "error", "{", "return", "os", ".", "Remove", "(", "s", ".", "Path", "(", "filepath", ")", ")", "\n", "}" ]
// Delete the file from storage
[ "Delete", "the", "file", "from", "storage" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/fs.go#L109-L111
151,824
ulule/gostorages
fs.go
Exists
func (s *FileSystemStorage) Exists(filepath string) bool { _, err := os.Stat(s.Path(filepath)) return err == nil }
go
func (s *FileSystemStorage) Exists(filepath string) bool { _, err := os.Stat(s.Path(filepath)) return err == nil }
[ "func", "(", "s", "*", "FileSystemStorage", ")", "Exists", "(", "filepath", "string", ")", "bool", "{", "_", ",", "err", ":=", "os", ".", "Stat", "(", "s", ".", "Path", "(", "filepath", ")", ")", "\n", "return", "err", "==", "nil", "\n", "}" ]
// Exists checks if the given file is in the storage
[ "Exists", "checks", "if", "the", "given", "file", "is", "in", "the", "storage" ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/fs.go#L124-L127
151,825
ulule/gostorages
fs.go
CreatedTime
func (s *FileSystemStorage) CreatedTime(filepath string) (time.Time, error) { t, err := times.Stat(s.Path(filepath)) if err != nil { return time.Time{}, err } return t.ChangeTime(), nil }
go
func (s *FileSystemStorage) CreatedTime(filepath string) (time.Time, error) { t, err := times.Stat(s.Path(filepath)) if err != nil { return time.Time{}, err } return t.ChangeTime(), nil }
[ "func", "(", "s", "*", "FileSystemStorage", ")", "CreatedTime", "(", "filepath", "string", ")", "(", "time", ".", "Time", ",", "error", ")", "{", "t", ",", "err", ":=", "times", ".", "Stat", "(", "s", ".", "Path", "(", "filepath", ")", ")", "\n", ...
// CreatedTime returns the last access time.
[ "CreatedTime", "returns", "the", "last", "access", "time", "." ]
e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c
https://github.com/ulule/gostorages/blob/e2229fc2f445b6a607e1fa0a1fe2d0f7cad8a97c/fs.go#L139-L146
151,826
cgrates/ltcache
cache.go
NewCache
func NewCache(maxEntries int, ttl time.Duration, staticTTL bool, onEvicted func(itmID string, value interface{})) (c *Cache) { c = &Cache{ cache: make(map[string]*cachedItem), groups: make(map[string]map[string]struct{}), onEvicted: onEvicted, maxEntries: maxEntries, ttl: ttl, staticTTL: staticTTL, lruIdx: list.New(), lruRefs: make(map[string]*list.Element), ttlIdx: list.New(), ttlRefs: make(map[string]*list.Element), } if c.ttl > 0 { go c.cleanExpired() } return }
go
func NewCache(maxEntries int, ttl time.Duration, staticTTL bool, onEvicted func(itmID string, value interface{})) (c *Cache) { c = &Cache{ cache: make(map[string]*cachedItem), groups: make(map[string]map[string]struct{}), onEvicted: onEvicted, maxEntries: maxEntries, ttl: ttl, staticTTL: staticTTL, lruIdx: list.New(), lruRefs: make(map[string]*list.Element), ttlIdx: list.New(), ttlRefs: make(map[string]*list.Element), } if c.ttl > 0 { go c.cleanExpired() } return }
[ "func", "NewCache", "(", "maxEntries", "int", ",", "ttl", "time", ".", "Duration", ",", "staticTTL", "bool", ",", "onEvicted", "func", "(", "itmID", "string", ",", "value", "interface", "{", "}", ")", ")", "(", "c", "*", "Cache", ")", "{", "c", "=", ...
// New initializes a new cache.
[ "New", "initializes", "a", "new", "cache", "." ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L54-L72
151,827
cgrates/ltcache
cache.go
Get
func (c *Cache) Get(itmID string) (value interface{}, ok bool) { c.Lock() defer c.Unlock() ci, has := c.cache[itmID] if !has { return } value, ok = ci.value, true if c.maxEntries != UnlimitedCaching { // update lru indexes c.lruIdx.MoveToFront(c.lruRefs[itmID]) } if c.ttl > 0 && !c.staticTTL { // update ttl indexes ci.expiryTime = time.Now().Add(c.ttl) c.ttlIdx.MoveToFront(c.ttlRefs[itmID]) } return }
go
func (c *Cache) Get(itmID string) (value interface{}, ok bool) { c.Lock() defer c.Unlock() ci, has := c.cache[itmID] if !has { return } value, ok = ci.value, true if c.maxEntries != UnlimitedCaching { // update lru indexes c.lruIdx.MoveToFront(c.lruRefs[itmID]) } if c.ttl > 0 && !c.staticTTL { // update ttl indexes ci.expiryTime = time.Now().Add(c.ttl) c.ttlIdx.MoveToFront(c.ttlRefs[itmID]) } return }
[ "func", "(", "c", "*", "Cache", ")", "Get", "(", "itmID", "string", ")", "(", "value", "interface", "{", "}", ",", "ok", "bool", ")", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n", "ci", ",", "has", ":=", ...
// Get looks up a key's value from the cache
[ "Get", "looks", "up", "a", "key", "s", "value", "from", "the", "cache" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L75-L91
151,828
cgrates/ltcache
cache.go
GetItemIDs
func (c *Cache) GetItemIDs(prfx string) (itmIDs []string) { c.RLock() for itmID := range c.cache { if strings.HasPrefix(itmID, prfx) { itmIDs = append(itmIDs, itmID) } } c.RUnlock() return }
go
func (c *Cache) GetItemIDs(prfx string) (itmIDs []string) { c.RLock() for itmID := range c.cache { if strings.HasPrefix(itmID, prfx) { itmIDs = append(itmIDs, itmID) } } c.RUnlock() return }
[ "func", "(", "c", "*", "Cache", ")", "GetItemIDs", "(", "prfx", "string", ")", "(", "itmIDs", "[", "]", "string", ")", "{", "c", ".", "RLock", "(", ")", "\n", "for", "itmID", ":=", "range", "c", ".", "cache", "{", "if", "strings", ".", "HasPrefix...
// GetItemIDs returns a list of items matching prefix
[ "GetItemIDs", "returns", "a", "list", "of", "items", "matching", "prefix" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L163-L172
151,829
cgrates/ltcache
cache.go
GroupLength
func (c *Cache) GroupLength(grpID string) int { c.RLock() defer c.RUnlock() return len(c.groups[grpID]) }
go
func (c *Cache) GroupLength(grpID string) int { c.RLock() defer c.RUnlock() return len(c.groups[grpID]) }
[ "func", "(", "c", "*", "Cache", ")", "GroupLength", "(", "grpID", "string", ")", "int", "{", "c", ".", "RLock", "(", ")", "\n", "defer", "c", ".", "RUnlock", "(", ")", "\n", "return", "len", "(", "c", ".", "groups", "[", "grpID", "]", ")", "\n"...
// GroupLength returns the length of a group
[ "GroupLength", "returns", "the", "length", "of", "a", "group" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L175-L179
151,830
cgrates/ltcache
cache.go
remove
func (c *Cache) remove(itmID string) { ci, has := c.cache[itmID] if !has { return } if c.maxEntries != UnlimitedCaching { c.lruIdx.Remove(c.lruRefs[itmID]) delete(c.lruRefs, itmID) } if c.ttl > 0 { c.ttlIdx.Remove(c.ttlRefs[itmID]) delete(c.ttlRefs, itmID) } c.remItemFromGroups(ci.itemID, ci.groupIDs) delete(c.cache, ci.itemID) if c.onEvicted != nil { c.onEvicted(ci.itemID, ci.value) } }
go
func (c *Cache) remove(itmID string) { ci, has := c.cache[itmID] if !has { return } if c.maxEntries != UnlimitedCaching { c.lruIdx.Remove(c.lruRefs[itmID]) delete(c.lruRefs, itmID) } if c.ttl > 0 { c.ttlIdx.Remove(c.ttlRefs[itmID]) delete(c.ttlRefs, itmID) } c.remItemFromGroups(ci.itemID, ci.groupIDs) delete(c.cache, ci.itemID) if c.onEvicted != nil { c.onEvicted(ci.itemID, ci.value) } }
[ "func", "(", "c", "*", "Cache", ")", "remove", "(", "itmID", "string", ")", "{", "ci", ",", "has", ":=", "c", ".", "cache", "[", "itmID", "]", "\n", "if", "!", "has", "{", "return", "\n", "}", "\n", "if", "c", ".", "maxEntries", "!=", "Unlimite...
// remove completely removes an Element from the cache
[ "remove", "completely", "removes", "an", "Element", "from", "the", "cache" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L219-L237
151,831
cgrates/ltcache
cache.go
cleanExpired
func (c *Cache) cleanExpired() { for { c.Lock() if c.ttlIdx.Len() == 0 { c.Unlock() time.Sleep(c.ttl) continue } ci := c.ttlIdx.Back().Value.(*cachedItem) now := time.Now() if now.Before(ci.expiryTime) { c.Unlock() time.Sleep(ci.expiryTime.Sub(now)) continue } c.remove(ci.itemID) c.Unlock() } }
go
func (c *Cache) cleanExpired() { for { c.Lock() if c.ttlIdx.Len() == 0 { c.Unlock() time.Sleep(c.ttl) continue } ci := c.ttlIdx.Back().Value.(*cachedItem) now := time.Now() if now.Before(ci.expiryTime) { c.Unlock() time.Sleep(ci.expiryTime.Sub(now)) continue } c.remove(ci.itemID) c.Unlock() } }
[ "func", "(", "c", "*", "Cache", ")", "cleanExpired", "(", ")", "{", "for", "{", "c", ".", "Lock", "(", ")", "\n", "if", "c", ".", "ttlIdx", ".", "Len", "(", ")", "==", "0", "{", "c", ".", "Unlock", "(", ")", "\n", "time", ".", "Sleep", "(",...
// cleanExpired checks items indexed for TTL and expires them when necessary
[ "cleanExpired", "checks", "items", "indexed", "for", "TTL", "and", "expires", "them", "when", "necessary" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L240-L258
151,832
cgrates/ltcache
cache.go
addItemToGroups
func (c *Cache) addItemToGroups(itmKey string, groupIDs []string) { for _, grpID := range groupIDs { if _, has := c.groups[grpID]; !has { c.groups[grpID] = make(map[string]struct{}) } c.groups[grpID][itmKey] = struct{}{} } }
go
func (c *Cache) addItemToGroups(itmKey string, groupIDs []string) { for _, grpID := range groupIDs { if _, has := c.groups[grpID]; !has { c.groups[grpID] = make(map[string]struct{}) } c.groups[grpID][itmKey] = struct{}{} } }
[ "func", "(", "c", "*", "Cache", ")", "addItemToGroups", "(", "itmKey", "string", ",", "groupIDs", "[", "]", "string", ")", "{", "for", "_", ",", "grpID", ":=", "range", "groupIDs", "{", "if", "_", ",", "has", ":=", "c", ".", "groups", "[", "grpID",...
// addItemToGroups adds and item to a group
[ "addItemToGroups", "adds", "and", "item", "to", "a", "group" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L261-L268
151,833
cgrates/ltcache
cache.go
remItemFromGroups
func (c *Cache) remItemFromGroups(itmKey string, groupIDs []string) { for _, grpID := range groupIDs { delete(c.groups[grpID], itmKey) if len(c.groups[grpID]) == 0 { delete(c.groups, grpID) } } }
go
func (c *Cache) remItemFromGroups(itmKey string, groupIDs []string) { for _, grpID := range groupIDs { delete(c.groups[grpID], itmKey) if len(c.groups[grpID]) == 0 { delete(c.groups, grpID) } } }
[ "func", "(", "c", "*", "Cache", ")", "remItemFromGroups", "(", "itmKey", "string", ",", "groupIDs", "[", "]", "string", ")", "{", "for", "_", ",", "grpID", ":=", "range", "groupIDs", "{", "delete", "(", "c", ".", "groups", "[", "grpID", "]", ",", "...
// remItemFromGroups removes an item with itemKey from groups
[ "remItemFromGroups", "removes", "an", "item", "with", "itemKey", "from", "groups" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L271-L278
151,834
cgrates/ltcache
cache.go
Clear
func (c *Cache) Clear() { c.Lock() defer c.Unlock() if c.onEvicted != nil { for _, ci := range c.cache { c.onEvicted(ci.itemID, ci.value) } } c.cache = make(map[string]*cachedItem) c.groups = make(map[string]map[string]struct{}) c.lruIdx = c.lruIdx.Init() c.lruRefs = make(map[string]*list.Element) c.ttlIdx = c.ttlIdx.Init() c.ttlRefs = make(map[string]*list.Element) }
go
func (c *Cache) Clear() { c.Lock() defer c.Unlock() if c.onEvicted != nil { for _, ci := range c.cache { c.onEvicted(ci.itemID, ci.value) } } c.cache = make(map[string]*cachedItem) c.groups = make(map[string]map[string]struct{}) c.lruIdx = c.lruIdx.Init() c.lruRefs = make(map[string]*list.Element) c.ttlIdx = c.ttlIdx.Init() c.ttlRefs = make(map[string]*list.Element) }
[ "func", "(", "c", "*", "Cache", ")", "Clear", "(", ")", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n", "if", "c", ".", "onEvicted", "!=", "nil", "{", "for", "_", ",", "ci", ":=", "range", "c", ".", "cach...
// Clear purges all stored items from the cache.
[ "Clear", "purges", "all", "stored", "items", "from", "the", "cache", "." ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L288-L302
151,835
cgrates/ltcache
cache.go
GetCacheStats
func (c *Cache) GetCacheStats() (cs *CacheStats) { c.RLock() cs = &CacheStats{Items: len(c.cache), Groups: len(c.groups)} c.RUnlock() return }
go
func (c *Cache) GetCacheStats() (cs *CacheStats) { c.RLock() cs = &CacheStats{Items: len(c.cache), Groups: len(c.groups)} c.RUnlock() return }
[ "func", "(", "c", "*", "Cache", ")", "GetCacheStats", "(", ")", "(", "cs", "*", "CacheStats", ")", "{", "c", ".", "RLock", "(", ")", "\n", "cs", "=", "&", "CacheStats", "{", "Items", ":", "len", "(", "c", ".", "cache", ")", ",", "Groups", ":", ...
// GetStats will return the CacheStats for this instance
[ "GetStats", "will", "return", "the", "CacheStats", "for", "this", "instance" ]
92fb7fa77cca400b55d805e4a6d625443027c7f5
https://github.com/cgrates/ltcache/blob/92fb7fa77cca400b55d805e4a6d625443027c7f5/cache.go#L310-L315
151,836
rekby/gpt
gpt.go
CreateTableForNewDiskSize
func (this Table) CreateTableForNewDiskSize(size uint64) (res Table) { res = this.copy() // Always create primary table res.Header.HeaderStartLBA = 1 res.Header.PartitionsTableStartLBA = 2 res.Header.HeaderCopyStartLBA = size - 1 // Last sector partitionsTableSize := uint64(res.Header.PartitionEntrySize) * uint64(res.Header.PartitionsArrLen) partitionSizeInSector := partitionsTableSize / uint64(res.SectorSize) if partitionsTableSize%uint64(res.SectorSize) != 0 { partitionSizeInSector++ } res.Header.LastUsableLBA = size - 1 - partitionSizeInSector - 1 // header in last sector and partitions table res.Header.CRC = res.Header.calcCRC() return res }
go
func (this Table) CreateTableForNewDiskSize(size uint64) (res Table) { res = this.copy() // Always create primary table res.Header.HeaderStartLBA = 1 res.Header.PartitionsTableStartLBA = 2 res.Header.HeaderCopyStartLBA = size - 1 // Last sector partitionsTableSize := uint64(res.Header.PartitionEntrySize) * uint64(res.Header.PartitionsArrLen) partitionSizeInSector := partitionsTableSize / uint64(res.SectorSize) if partitionsTableSize%uint64(res.SectorSize) != 0 { partitionSizeInSector++ } res.Header.LastUsableLBA = size - 1 - partitionSizeInSector - 1 // header in last sector and partitions table res.Header.CRC = res.Header.calcCRC() return res }
[ "func", "(", "this", "Table", ")", "CreateTableForNewDiskSize", "(", "size", "uint64", ")", "(", "res", "Table", ")", "{", "res", "=", "this", ".", "copy", "(", ")", "\n\n", "// Always create primary table", "res", ".", "Header", ".", "HeaderStartLBA", "=", ...
// Create primary table for resized disk // size - in sectors
[ "Create", "primary", "table", "for", "resized", "disk", "size", "-", "in", "sectors" ]
520ac65554cffa63270eeb0723c59c08b319a94d
https://github.com/rekby/gpt/blob/520ac65554cffa63270eeb0723c59c08b319a94d/gpt.go#L271-L288
151,837
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
SimpleCommandFn
func (bot *TgBot) SimpleCommandFn(path string, f func(TgBot, Message, string) *string) *TgBot { path = convertToCommand(path) path = bot.addUsernameCommand(path) r := regexp.MustCompile(path) newf := SimpleCommandFuncStruct{f} bot.addToConditionalFuncs(TextConditionalCall{RegexCommand{r, newf.CallSimpleCommandFunc}}) return bot }
go
func (bot *TgBot) SimpleCommandFn(path string, f func(TgBot, Message, string) *string) *TgBot { path = convertToCommand(path) path = bot.addUsernameCommand(path) r := regexp.MustCompile(path) newf := SimpleCommandFuncStruct{f} bot.addToConditionalFuncs(TextConditionalCall{RegexCommand{r, newf.CallSimpleCommandFunc}}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "SimpleCommandFn", "(", "path", "string", ",", "f", "func", "(", "TgBot", ",", "Message", ",", "string", ")", "*", "string", ")", "*", "TgBot", "{", "path", "=", "convertToCommand", "(", "path", ")", "\n", "path...
// SimpleCommandFn Add a simple command function.
[ "SimpleCommandFn", "Add", "a", "simple", "command", "function", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L16-L24
151,838
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
MultiCommandFn
func (bot *TgBot) MultiCommandFn(paths []string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot { rc := []*regexp.Regexp{} for _, p := range paths { p = convertToCommand(p) p = bot.addUsernameCommand(p) r := regexp.MustCompile(p) rc = append(rc, r) } bot.addToConditionalFuncs(TextConditionalCall{MultiRegexCommand{rc, f}}) return bot }
go
func (bot *TgBot) MultiCommandFn(paths []string, f func(TgBot, Message, []string, map[string]string) *string) *TgBot { rc := []*regexp.Regexp{} for _, p := range paths { p = convertToCommand(p) p = bot.addUsernameCommand(p) r := regexp.MustCompile(p) rc = append(rc, r) } bot.addToConditionalFuncs(TextConditionalCall{MultiRegexCommand{rc, f}}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "MultiCommandFn", "(", "paths", "[", "]", "string", ",", "f", "func", "(", "TgBot", ",", "Message", ",", "[", "]", "string", ",", "map", "[", "string", "]", "string", ")", "*", "string", ")", "*", "TgBot", "...
// MultiCommandFn add multiples commands with capture groups. Only one of this will be executed.
[ "MultiCommandFn", "add", "multiples", "commands", "with", "capture", "groups", ".", "Only", "one", "of", "this", "will", "be", "executed", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L27-L38
151,839
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
SimpleRegexFn
func (bot *TgBot) SimpleRegexFn(path string, f func(TgBot, Message, string) *string) *TgBot { r := regexp.MustCompile(path) newf := SimpleCommandFuncStruct{f} bot.addToConditionalFuncs(TextConditionalCall{RegexCommand{r, newf.CallSimpleCommandFunc}}) return bot }
go
func (bot *TgBot) SimpleRegexFn(path string, f func(TgBot, Message, string) *string) *TgBot { r := regexp.MustCompile(path) newf := SimpleCommandFuncStruct{f} bot.addToConditionalFuncs(TextConditionalCall{RegexCommand{r, newf.CallSimpleCommandFunc}}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "SimpleRegexFn", "(", "path", "string", ",", "f", "func", "(", "TgBot", ",", "Message", ",", "string", ")", "*", "string", ")", "*", "TgBot", "{", "r", ":=", "regexp", ".", "MustCompile", "(", "path", ")", "\n...
// SimpleRegexFn add a simple regular expression function.
[ "SimpleRegexFn", "add", "a", "simple", "regular", "expression", "function", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L49-L55
151,840
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
ImageFn
func (bot *TgBot) ImageFn(f func(TgBot, Message, []PhotoSize, string)) *TgBot { bot.addToConditionalFuncs(ImageConditionalCall{f}) return bot }
go
func (bot *TgBot) ImageFn(f func(TgBot, Message, []PhotoSize, string)) *TgBot { bot.addToConditionalFuncs(ImageConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "ImageFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "[", "]", "PhotoSize", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "ImageConditionalCall", "{", "f", "}", ...
// ImageFn add a function to be called when an image arrives.
[ "ImageFn", "add", "a", "function", "to", "be", "called", "when", "an", "image", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L70-L73
151,841
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
AudioFn
func (bot *TgBot) AudioFn(f func(TgBot, Message, Audio, string)) *TgBot { bot.addToConditionalFuncs(AudioConditionalCall{f}) return bot }
go
func (bot *TgBot) AudioFn(f func(TgBot, Message, Audio, string)) *TgBot { bot.addToConditionalFuncs(AudioConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "AudioFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "Audio", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "AudioConditionalCall", "{", "f", "}", ")", "\n", "r...
// AudioFn add a function to be called when an audio arrives.
[ "AudioFn", "add", "a", "function", "to", "be", "called", "when", "an", "audio", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L76-L79
151,842
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
VoiceFn
func (bot *TgBot) VoiceFn(f func(TgBot, Message, Voice, string)) *TgBot { bot.addToConditionalFuncs(VoiceConditionalCall{f}) return bot }
go
func (bot *TgBot) VoiceFn(f func(TgBot, Message, Voice, string)) *TgBot { bot.addToConditionalFuncs(VoiceConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "VoiceFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "Voice", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "VoiceConditionalCall", "{", "f", "}", ")", "\n", "r...
// VoiceFn add a function to be called when an audio arrives.
[ "VoiceFn", "add", "a", "function", "to", "be", "called", "when", "an", "audio", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L82-L85
151,843
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
DocumentFn
func (bot *TgBot) DocumentFn(f func(TgBot, Message, Document, string)) *TgBot { bot.addToConditionalFuncs(DocumentConditionalCall{f}) return bot }
go
func (bot *TgBot) DocumentFn(f func(TgBot, Message, Document, string)) *TgBot { bot.addToConditionalFuncs(DocumentConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "DocumentFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "Document", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "DocumentConditionalCall", "{", "f", "}", ")", "...
// DocumentFn add a function to be called when a document arrives.
[ "DocumentFn", "add", "a", "function", "to", "be", "called", "when", "a", "document", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L88-L91
151,844
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
StickerFn
func (bot *TgBot) StickerFn(f func(TgBot, Message, Sticker, string)) *TgBot { bot.addToConditionalFuncs(StickerConditionalCall{f}) return bot }
go
func (bot *TgBot) StickerFn(f func(TgBot, Message, Sticker, string)) *TgBot { bot.addToConditionalFuncs(StickerConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "StickerFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "Sticker", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "StickerConditionalCall", "{", "f", "}", ")", "\n"...
// StickerFn add a function to be called when a sticker arrives.
[ "StickerFn", "add", "a", "function", "to", "be", "called", "when", "a", "sticker", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L94-L97
151,845
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
VideoFn
func (bot *TgBot) VideoFn(f func(TgBot, Message, Video, string)) *TgBot { bot.addToConditionalFuncs(VideoConditionalCall{f}) return bot }
go
func (bot *TgBot) VideoFn(f func(TgBot, Message, Video, string)) *TgBot { bot.addToConditionalFuncs(VideoConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "VideoFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "Video", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "VideoConditionalCall", "{", "f", "}", ")", "\n", "r...
// VideoFn add a function to be called when a video arrives.
[ "VideoFn", "add", "a", "function", "to", "be", "called", "when", "a", "video", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L100-L103
151,846
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
LocationFn
func (bot *TgBot) LocationFn(f func(TgBot, Message, float64, float64)) *TgBot { bot.addToConditionalFuncs(LocationConditionalCall{f}) return bot }
go
func (bot *TgBot) LocationFn(f func(TgBot, Message, float64, float64)) *TgBot { bot.addToConditionalFuncs(LocationConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "LocationFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "float64", ",", "float64", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "LocationConditionalCall", "{", "f", "}", ")", "...
// LocationFn add a function to be called when a location arrives.
[ "LocationFn", "add", "a", "function", "to", "be", "called", "when", "a", "location", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L106-L109
151,847
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
ReplyFn
func (bot *TgBot) ReplyFn(f func(TgBot, Message, Message)) *TgBot { bot.addToConditionalFuncs(RepliedConditionalCall{f}) return bot }
go
func (bot *TgBot) ReplyFn(f func(TgBot, Message, Message)) *TgBot { bot.addToConditionalFuncs(RepliedConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "ReplyFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "Message", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "RepliedConditionalCall", "{", "f", "}", ")", "\n", "return", "bot"...
// ReplyFn add a function to be called when a message replied other is arrives.
[ "ReplyFn", "add", "a", "function", "to", "be", "called", "when", "a", "message", "replied", "other", "is", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L112-L115
151,848
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
ForwardFn
func (bot *TgBot) ForwardFn(f func(TgBot, Message, User, int)) *TgBot { bot.addToConditionalFuncs(ForwardConditionalCall{f}) return bot }
go
func (bot *TgBot) ForwardFn(f func(TgBot, Message, User, int)) *TgBot { bot.addToConditionalFuncs(ForwardConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "ForwardFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "User", ",", "int", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "ForwardConditionalCall", "{", "f", "}", ")", "\n", "r...
// ForwardFn add a function to be called when a message forwarding other arrives.
[ "ForwardFn", "add", "a", "function", "to", "be", "called", "when", "a", "message", "forwarding", "other", "arrives", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L118-L121
151,849
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
GroupFn
func (bot *TgBot) GroupFn(f func(TgBot, Message, int, string)) *TgBot { bot.addToConditionalFuncs(GroupConditionalCall{f}) return bot }
go
func (bot *TgBot) GroupFn(f func(TgBot, Message, int, string)) *TgBot { bot.addToConditionalFuncs(GroupConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "GroupFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "int", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "GroupConditionalCall", "{", "f", "}", ")", "\n", "ret...
// GroupFn add a function to be called in every group message.
[ "GroupFn", "add", "a", "function", "to", "be", "called", "in", "every", "group", "message", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L124-L127
151,850
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
NewParticipantFn
func (bot *TgBot) NewParticipantFn(f func(TgBot, Message, int, User)) *TgBot { bot.addToConditionalFuncs(NewParticipantConditionalCall{f}) return bot }
go
func (bot *TgBot) NewParticipantFn(f func(TgBot, Message, int, User)) *TgBot { bot.addToConditionalFuncs(NewParticipantConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "NewParticipantFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "int", ",", "User", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "NewParticipantConditionalCall", "{", "f", "}", ")"...
// NewParticipantFn add a function to be called when new participant is received.
[ "NewParticipantFn", "add", "a", "function", "to", "be", "called", "when", "new", "participant", "is", "received", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L130-L133
151,851
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
LeftParticipantFn
func (bot *TgBot) LeftParticipantFn(f func(TgBot, Message, int, User)) *TgBot { bot.addToConditionalFuncs(LeftParticipantConditionalCall{f}) return bot }
go
func (bot *TgBot) LeftParticipantFn(f func(TgBot, Message, int, User)) *TgBot { bot.addToConditionalFuncs(LeftParticipantConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "LeftParticipantFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "int", ",", "User", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "LeftParticipantConditionalCall", "{", "f", "}", "...
// LeftParticipantFn add a function to be called when a participant left.
[ "LeftParticipantFn", "add", "a", "function", "to", "be", "called", "when", "a", "participant", "left", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L136-L139
151,852
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
NewTitleChatFn
func (bot *TgBot) NewTitleChatFn(f func(TgBot, Message, int, string)) *TgBot { bot.addToConditionalFuncs(NewTitleConditionalCall{f}) return bot }
go
func (bot *TgBot) NewTitleChatFn(f func(TgBot, Message, int, string)) *TgBot { bot.addToConditionalFuncs(NewTitleConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "NewTitleChatFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "int", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "NewTitleConditionalCall", "{", "f", "}", ")", "\...
// NewTitleChatFn add a function to be called when the title of a group is changed.
[ "NewTitleChatFn", "add", "a", "function", "to", "be", "called", "when", "the", "title", "of", "a", "group", "is", "changed", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L142-L145
151,853
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
NewPhotoChatFn
func (bot *TgBot) NewPhotoChatFn(f func(TgBot, Message, int, string)) *TgBot { bot.addToConditionalFuncs(NewPhotoConditionalCall{f}) return bot }
go
func (bot *TgBot) NewPhotoChatFn(f func(TgBot, Message, int, string)) *TgBot { bot.addToConditionalFuncs(NewPhotoConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "NewPhotoChatFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "int", ",", "string", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "NewPhotoConditionalCall", "{", "f", "}", ")", "\...
// NewPhotoChatFn add a function to be called when the photo of a chat is changed.
[ "NewPhotoChatFn", "add", "a", "function", "to", "be", "called", "when", "the", "photo", "of", "a", "chat", "is", "changed", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L148-L151
151,854
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
DeleteChatPhotoFn
func (bot *TgBot) DeleteChatPhotoFn(f func(TgBot, Message, int)) *TgBot { bot.addToConditionalFuncs(DeleteChatPhotoConditionalCall{f}) return bot }
go
func (bot *TgBot) DeleteChatPhotoFn(f func(TgBot, Message, int)) *TgBot { bot.addToConditionalFuncs(DeleteChatPhotoConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "DeleteChatPhotoFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "int", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "DeleteChatPhotoConditionalCall", "{", "f", "}", ")", "\n", "re...
// DeleteChatPhotoFn add a function to be called when the photo of a chat is deleted.
[ "DeleteChatPhotoFn", "add", "a", "function", "to", "be", "called", "when", "the", "photo", "of", "a", "chat", "is", "deleted", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L154-L157
151,855
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
GroupChatCreatedFn
func (bot *TgBot) GroupChatCreatedFn(f func(TgBot, Message, int)) *TgBot { bot.addToConditionalFuncs(GroupChatCreatedConditionalCall{f}) return bot }
go
func (bot *TgBot) GroupChatCreatedFn(f func(TgBot, Message, int)) *TgBot { bot.addToConditionalFuncs(GroupChatCreatedConditionalCall{f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "GroupChatCreatedFn", "(", "f", "func", "(", "TgBot", ",", "Message", ",", "int", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "GroupChatCreatedConditionalCall", "{", "f", "}", ")", "\n", "...
// GroupChatCreatedFn add a function to be called when a group chat is created.
[ "GroupChatCreatedFn", "add", "a", "function", "to", "be", "called", "when", "a", "group", "chat", "is", "created", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L160-L163
151,856
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
CustomFn
func (bot *TgBot) CustomFn(cond func(TgBot, Message) bool, f func(TgBot, Message)) *TgBot { bot.addToConditionalFuncs(CustomCall{cond, f}) return bot }
go
func (bot *TgBot) CustomFn(cond func(TgBot, Message) bool, f func(TgBot, Message)) *TgBot { bot.addToConditionalFuncs(CustomCall{cond, f}) return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "CustomFn", "(", "cond", "func", "(", "TgBot", ",", "Message", ")", "bool", ",", "f", "func", "(", "TgBot", ",", "Message", ")", ")", "*", "TgBot", "{", "bot", ".", "addToConditionalFuncs", "(", "CustomCall", "{...
// CustomFn add a function to be called with a custom conditional function.
[ "CustomFn", "add", "a", "function", "to", "be", "called", "with", "a", "custom", "conditional", "function", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L177-L180
151,857
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
StartChain
func (bot *TgBot) StartChain() *TgBot { bot.ChainConditionals = append(bot.ChainConditionals, NewChainStructure()) bot.BuildingChain = true return bot }
go
func (bot *TgBot) StartChain() *TgBot { bot.ChainConditionals = append(bot.ChainConditionals, NewChainStructure()) bot.BuildingChain = true return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "StartChain", "(", ")", "*", "TgBot", "{", "bot", ".", "ChainConditionals", "=", "append", "(", "bot", ".", "ChainConditionals", ",", "NewChainStructure", "(", ")", ")", "\n", "bot", ".", "BuildingChain", "=", "true...
// StartChain will start a chain process, all the functions you add after this will be part of the same chain.
[ "StartChain", "will", "start", "a", "chain", "process", "all", "the", "functions", "you", "add", "after", "this", "will", "be", "part", "of", "the", "same", "chain", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L183-L187
151,858
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
CancelChainCommand
func (bot *TgBot) CancelChainCommand(path string, f func(TgBot, Message, string) *string) *TgBot { if !bot.BuildingChain { return bot } if len(bot.ChainConditionals) > 0 { path = convertToCommand(path) path = bot.addUsernameCommand(path) r := regexp.MustCompile(path) newf := SimpleCommandFuncStruct{f} bot.ChainConditionals[len(bot.ChainConditionals)-1]. SetCancelCond(TextConditionalCall{RegexCommand{r, newf.CallSimpleCommandFunc}}) } return bot }
go
func (bot *TgBot) CancelChainCommand(path string, f func(TgBot, Message, string) *string) *TgBot { if !bot.BuildingChain { return bot } if len(bot.ChainConditionals) > 0 { path = convertToCommand(path) path = bot.addUsernameCommand(path) r := regexp.MustCompile(path) newf := SimpleCommandFuncStruct{f} bot.ChainConditionals[len(bot.ChainConditionals)-1]. SetCancelCond(TextConditionalCall{RegexCommand{r, newf.CallSimpleCommandFunc}}) } return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "CancelChainCommand", "(", "path", "string", ",", "f", "func", "(", "TgBot", ",", "Message", ",", "string", ")", "*", "string", ")", "*", "TgBot", "{", "if", "!", "bot", ".", "BuildingChain", "{", "return", "bot...
// CancelChainCommand add a special command that cancel the current chain
[ "CancelChainCommand", "add", "a", "special", "command", "that", "cancel", "the", "current", "chain" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L190-L204
151,859
rockneurotiko/go-tgbot
tgbot-callbackfunctions.go
LoopChain
func (bot *TgBot) LoopChain() *TgBot { if !bot.BuildingChain { return bot } if len(bot.ChainConditionals) > 0 { bot.ChainConditionals[len(bot.ChainConditionals)-1].SetLoop(true) } return bot }
go
func (bot *TgBot) LoopChain() *TgBot { if !bot.BuildingChain { return bot } if len(bot.ChainConditionals) > 0 { bot.ChainConditionals[len(bot.ChainConditionals)-1].SetLoop(true) } return bot }
[ "func", "(", "bot", "*", "TgBot", ")", "LoopChain", "(", ")", "*", "TgBot", "{", "if", "!", "bot", ".", "BuildingChain", "{", "return", "bot", "\n", "}", "\n", "if", "len", "(", "bot", ".", "ChainConditionals", ")", ">", "0", "{", "bot", ".", "Ch...
// LoopChain will make the chain start again when the last action is done.
[ "LoopChain", "will", "make", "the", "chain", "start", "again", "when", "the", "last", "action", "is", "done", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-callbackfunctions.go#L207-L215
151,860
rockneurotiko/go-tgbot
tgbot-defaultoptions.go
hookPayload
func hookPayload(payload interface{}, opts DefaultOptionsBot) { hookDisableWebpage(payload, opts.DisableWebURL) // HookReplyToMessageID(payload, opts.ReplyToMessageID) has, _ := reflections.HasField(payload, "ReplyMarkup") if has { keyint, _ := reflections.GetField(payload, "ReplyMarkup") switch val := keyint.(type) { case *ForceReply, *ReplyKeyboardHide: if val != nil { hookSelective(val, opts.Selective) } case *ReplyKeyboardMarkup: if val != nil { hookOneTimeKeyboard(val, opts.OneTimeKeyboard) hookSelective(val, opts.Selective) } default: } } }
go
func hookPayload(payload interface{}, opts DefaultOptionsBot) { hookDisableWebpage(payload, opts.DisableWebURL) // HookReplyToMessageID(payload, opts.ReplyToMessageID) has, _ := reflections.HasField(payload, "ReplyMarkup") if has { keyint, _ := reflections.GetField(payload, "ReplyMarkup") switch val := keyint.(type) { case *ForceReply, *ReplyKeyboardHide: if val != nil { hookSelective(val, opts.Selective) } case *ReplyKeyboardMarkup: if val != nil { hookOneTimeKeyboard(val, opts.OneTimeKeyboard) hookSelective(val, opts.Selective) } default: } } }
[ "func", "hookPayload", "(", "payload", "interface", "{", "}", ",", "opts", "DefaultOptionsBot", ")", "{", "hookDisableWebpage", "(", "payload", ",", "opts", ".", "DisableWebURL", ")", "\n", "// HookReplyToMessageID(payload, opts.ReplyToMessageID)", "has", ",", "_", ...
// HookPayload I hate reflection, sorry for that <3
[ "HookPayload", "I", "hate", "reflection", "sorry", "for", "that", "<3" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-defaultoptions.go#L109-L131
151,861
rockneurotiko/go-tgbot
tgbot-apicalls.go
GetMe
func (bot TgBot) GetMe() (User, error) { body, err := getPetition(bot.buildPath("getMe"), nil) if err != nil { return User{}, err } var data ResultGetUser dec := json.NewDecoder(strings.NewReader(body)) dec.Decode(&data) if !data.Ok { errc := 403 desc := "" if data.ErrorCode != nil { errc = *data.ErrorCode } if data.Description != nil { desc = *data.Description } errormsg := fmt.Sprintf("Some error happened, maybe your token is bad:\nError code: %d\nDescription: %s\nToken: %s", errc, desc, bot.Token) return User{}, errors.New(errormsg) } return data.Result, nil }
go
func (bot TgBot) GetMe() (User, error) { body, err := getPetition(bot.buildPath("getMe"), nil) if err != nil { return User{}, err } var data ResultGetUser dec := json.NewDecoder(strings.NewReader(body)) dec.Decode(&data) if !data.Ok { errc := 403 desc := "" if data.ErrorCode != nil { errc = *data.ErrorCode } if data.Description != nil { desc = *data.Description } errormsg := fmt.Sprintf("Some error happened, maybe your token is bad:\nError code: %d\nDescription: %s\nToken: %s", errc, desc, bot.Token) return User{}, errors.New(errormsg) } return data.Result, nil }
[ "func", "(", "bot", "TgBot", ")", "GetMe", "(", ")", "(", "User", ",", "error", ")", "{", "body", ",", "err", ":=", "getPetition", "(", "bot", ".", "buildPath", "(", "\"", "\"", ")", ",", "nil", ")", "\n\n", "if", "err", "!=", "nil", "{", "retu...
// GetMe Call getMe path
[ "GetMe", "Call", "getMe", "path" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L17-L42
151,862
rockneurotiko/go-tgbot
tgbot-apicalls.go
GetUpdates
func (bot TgBot) GetUpdates() ([]MessageWithUpdateID, error) { timeoutreq := fmt.Sprintf("timeout=%d", timeout) lastid := fmt.Sprintf("offset=%d", bot.LastUpdateID+1) body, err := getPetition(bot.buildPath("getUpdates"), []string{timeoutreq, lastid}) if err != nil { return []MessageWithUpdateID{}, err } var data ResultGetUpdates json.Unmarshal([]byte(body), &data) if !data.Ok { return []MessageWithUpdateID{}, errors.New("Some error happened in your petition, check your token or remove the webhook.") } return data.Result, nil }
go
func (bot TgBot) GetUpdates() ([]MessageWithUpdateID, error) { timeoutreq := fmt.Sprintf("timeout=%d", timeout) lastid := fmt.Sprintf("offset=%d", bot.LastUpdateID+1) body, err := getPetition(bot.buildPath("getUpdates"), []string{timeoutreq, lastid}) if err != nil { return []MessageWithUpdateID{}, err } var data ResultGetUpdates json.Unmarshal([]byte(body), &data) if !data.Ok { return []MessageWithUpdateID{}, errors.New("Some error happened in your petition, check your token or remove the webhook.") } return data.Result, nil }
[ "func", "(", "bot", "TgBot", ")", "GetUpdates", "(", ")", "(", "[", "]", "MessageWithUpdateID", ",", "error", ")", "{", "timeoutreq", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "timeout", ")", "\n", "lastid", ":=", "fmt", ".", "Sprintf", "(",...
// GetUpdates call getUpdates
[ "GetUpdates", "call", "getUpdates" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L45-L62
151,863
rockneurotiko/go-tgbot
tgbot-apicalls.go
SetWebhookQuery
func (bot TgBot) SetWebhookQuery(url *string, cert *string) ResultSetWebhook { if cert == nil { return bot.SetWebhookNoQuery(*url) } return bot.SetWebhookWithCert(*url, *cert) }
go
func (bot TgBot) SetWebhookQuery(url *string, cert *string) ResultSetWebhook { if cert == nil { return bot.SetWebhookNoQuery(*url) } return bot.SetWebhookWithCert(*url, *cert) }
[ "func", "(", "bot", "TgBot", ")", "SetWebhookQuery", "(", "url", "*", "string", ",", "cert", "*", "string", ")", "ResultSetWebhook", "{", "if", "cert", "==", "nil", "{", "return", "bot", ".", "SetWebhookNoQuery", "(", "*", "url", ")", "\n", "}", "\n", ...
// SetWebhookQuery raw method that uses the struct to send the petition.
[ "SetWebhookQuery", "raw", "method", "that", "uses", "the", "struct", "to", "send", "the", "petition", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L113-L118
151,864
rockneurotiko/go-tgbot
tgbot-apicalls.go
GetUserProfilePhotos
func (bot TgBot) GetUserProfilePhotos(uid int, args ...int) UserProfilePhotos { pet := ResultWithUserProfilePhotos{} getq := GetUserProfilePhotosQuery{uid, nil, nil} if len(args) == 1 { v1 := args[0] getq = GetUserProfilePhotosQuery{uid, nil, &v1} } else if len(args) >= 2 { v1 := args[0] v2 := args[1] getq = GetUserProfilePhotosQuery{uid, &v2, &v1} } pet = bot.GetUserProfilePhotosQuery(getq) if !pet.Ok || pet.Result == nil { return UserProfilePhotos{} } return *pet.Result }
go
func (bot TgBot) GetUserProfilePhotos(uid int, args ...int) UserProfilePhotos { pet := ResultWithUserProfilePhotos{} getq := GetUserProfilePhotosQuery{uid, nil, nil} if len(args) == 1 { v1 := args[0] getq = GetUserProfilePhotosQuery{uid, nil, &v1} } else if len(args) >= 2 { v1 := args[0] v2 := args[1] getq = GetUserProfilePhotosQuery{uid, &v2, &v1} } pet = bot.GetUserProfilePhotosQuery(getq) if !pet.Ok || pet.Result == nil { return UserProfilePhotos{} } return *pet.Result }
[ "func", "(", "bot", "TgBot", ")", "GetUserProfilePhotos", "(", "uid", "int", ",", "args", "...", "int", ")", "UserProfilePhotos", "{", "pet", ":=", "ResultWithUserProfilePhotos", "{", "}", "\n", "getq", ":=", "GetUserProfilePhotosQuery", "{", "uid", ",", "nil"...
// GetUserProfilePhotos args will use only the two first parameters, the first one will be the limit of images to get, and the second will be the offset photo id.
[ "GetUserProfilePhotos", "args", "will", "use", "only", "the", "two", "first", "parameters", "the", "first", "one", "will", "be", "the", "limit", "of", "images", "to", "get", "and", "the", "second", "will", "be", "the", "offset", "photo", "id", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L121-L139
151,865
rockneurotiko/go-tgbot
tgbot-apicalls.go
SimpleSendMessage
func (bot TgBot) SimpleSendMessage(msg Message, text string) (res Message, err error) { ressm := bot.SendMessage(msg.Chat.ID, text, nil, nil, nil, nil) return splitResultInMessageError(ressm) }
go
func (bot TgBot) SimpleSendMessage(msg Message, text string) (res Message, err error) { ressm := bot.SendMessage(msg.Chat.ID, text, nil, nil, nil, nil) return splitResultInMessageError(ressm) }
[ "func", "(", "bot", "TgBot", ")", "SimpleSendMessage", "(", "msg", "Message", ",", "text", "string", ")", "(", "res", "Message", ",", "err", "error", ")", "{", "ressm", ":=", "bot", ".", "SendMessage", "(", "msg", ".", "Chat", ".", "ID", ",", "text",...
// Send messages // SimpleSendMessage send a simple text message.
[ "Send", "messages", "SimpleSendMessage", "send", "a", "simple", "text", "message", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L144-L147
151,866
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendMessageWithKeyboard
func (bot TgBot) SendMessageWithKeyboard(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendMessage(cid, text, parsemode, dwp, rtmid, &rkm) }
go
func (bot TgBot) SendMessageWithKeyboard(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendMessage(cid, text, parsemode, dwp, rtmid, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendMessageWithKeyboard", "(", "cid", "int", ",", "text", "string", ",", "parsemode", "*", "ParseModeT", ",", "dwp", "*", "bool", ",", "rtmid", "*", "int", ",", "rm", "ReplyKeyboardMarkup", ")", "ResultWithMessage", "{", ...
// SendMessageWithKeyboard send a message with explicit Keyboard
[ "SendMessageWithKeyboard", "send", "a", "message", "with", "explicit", "Keyboard" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L150-L153
151,867
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendMessage
func (bot TgBot) SendMessage(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm *ReplyMarkupInt) ResultWithMessage { var pm *string = nil if parsemode != nil { pmt := parsemode.String() pm = &pmt } payload := QuerySendMessage{cid, text, pm, dwp, rtmid, rm} return bot.SendMessageQuery(payload) }
go
func (bot TgBot) SendMessage(cid int, text string, parsemode *ParseModeT, dwp *bool, rtmid *int, rm *ReplyMarkupInt) ResultWithMessage { var pm *string = nil if parsemode != nil { pmt := parsemode.String() pm = &pmt } payload := QuerySendMessage{cid, text, pm, dwp, rtmid, rm} return bot.SendMessageQuery(payload) }
[ "func", "(", "bot", "TgBot", ")", "SendMessage", "(", "cid", "int", ",", "text", "string", ",", "parsemode", "*", "ParseModeT", ",", "dwp", "*", "bool", ",", "rtmid", "*", "int", ",", "rm", "*", "ReplyMarkupInt", ")", "ResultWithMessage", "{", "var", "...
// SendMessage full function wrapper for sendMessage, uses the markup interface
[ "SendMessage", "full", "function", "wrapper", "for", "sendMessage", "uses", "the", "markup", "interface" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L168-L176
151,868
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendMessageQuery
func (bot TgBot) SendMessageQuery(payload QuerySendMessage) ResultWithMessage { url := bot.buildPath("sendMessage") hookPayload(&payload, bot.DefaultOptions) return bot.genericSendPostData(url, payload) }
go
func (bot TgBot) SendMessageQuery(payload QuerySendMessage) ResultWithMessage { url := bot.buildPath("sendMessage") hookPayload(&payload, bot.DefaultOptions) return bot.genericSendPostData(url, payload) }
[ "func", "(", "bot", "TgBot", ")", "SendMessageQuery", "(", "payload", "QuerySendMessage", ")", "ResultWithMessage", "{", "url", ":=", "bot", ".", "buildPath", "(", "\"", "\"", ")", "\n", "hookPayload", "(", "&", "payload", ",", "bot", ".", "DefaultOptions", ...
// SendMessageQuery full sendMessage with the query.
[ "SendMessageQuery", "full", "sendMessage", "with", "the", "query", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L179-L183
151,869
rockneurotiko/go-tgbot
tgbot-apicalls.go
ForwardMessage
func (bot TgBot) ForwardMessage(cid int, fid int, mid int) ResultWithMessage { payload := ForwardMessageQuery{cid, fid, mid} return bot.ForwardMessageQuery(payload) }
go
func (bot TgBot) ForwardMessage(cid int, fid int, mid int) ResultWithMessage { payload := ForwardMessageQuery{cid, fid, mid} return bot.ForwardMessageQuery(payload) }
[ "func", "(", "bot", "TgBot", ")", "ForwardMessage", "(", "cid", "int", ",", "fid", "int", ",", "mid", "int", ")", "ResultWithMessage", "{", "payload", ":=", "ForwardMessageQuery", "{", "cid", ",", "fid", ",", "mid", "}", "\n", "return", "bot", ".", "Fo...
// Forward Message!! // ForwardMessage full function wrapper for forwardMessage
[ "Forward", "Message!!", "ForwardMessage", "full", "function", "wrapper", "for", "forwardMessage" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L188-L191
151,870
rockneurotiko/go-tgbot
tgbot-apicalls.go
ForwardMessageQuery
func (bot TgBot) ForwardMessageQuery(payload ForwardMessageQuery) ResultWithMessage { url := bot.buildPath("forwardMessage") hookPayload(&payload, bot.DefaultOptions) return bot.genericSendPostData(url, payload) }
go
func (bot TgBot) ForwardMessageQuery(payload ForwardMessageQuery) ResultWithMessage { url := bot.buildPath("forwardMessage") hookPayload(&payload, bot.DefaultOptions) return bot.genericSendPostData(url, payload) }
[ "func", "(", "bot", "TgBot", ")", "ForwardMessageQuery", "(", "payload", "ForwardMessageQuery", ")", "ResultWithMessage", "{", "url", ":=", "bot", ".", "buildPath", "(", "\"", "\"", ")", "\n", "hookPayload", "(", "&", "payload", ",", "bot", ".", "DefaultOpti...
// ForwardMessageQuery full forwardMessage call
[ "ForwardMessageQuery", "full", "forwardMessage", "call" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L194-L198
151,871
rockneurotiko/go-tgbot
tgbot-apicalls.go
SimpleSendPhoto
func (bot TgBot) SimpleSendPhoto(msg Message, photo interface{}) (res Message, err error) { cid := msg.Chat.ID ressm := bot.SendPhoto(cid, photo, nil, nil, nil) return splitResultInMessageError(ressm) }
go
func (bot TgBot) SimpleSendPhoto(msg Message, photo interface{}) (res Message, err error) { cid := msg.Chat.ID ressm := bot.SendPhoto(cid, photo, nil, nil, nil) return splitResultInMessageError(ressm) }
[ "func", "(", "bot", "TgBot", ")", "SimpleSendPhoto", "(", "msg", "Message", ",", "photo", "interface", "{", "}", ")", "(", "res", "Message", ",", "err", "error", ")", "{", "cid", ":=", "msg", ".", "Chat", ".", "ID", "\n", "ressm", ":=", "bot", ".",...
// Send photo!! // SimpleSendPhoto send just a photo.
[ "Send", "photo!!", "SimpleSendPhoto", "send", "just", "a", "photo", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L203-L207
151,872
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendPhotoWithKeyboard
func (bot TgBot) SendPhotoWithKeyboard(cid int, photo interface{}, caption *string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendPhoto(cid, photo, caption, rmi, &rkm) }
go
func (bot TgBot) SendPhotoWithKeyboard(cid int, photo interface{}, caption *string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendPhoto(cid, photo, caption, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendPhotoWithKeyboard", "(", "cid", "int", ",", "photo", "interface", "{", "}", ",", "caption", "*", "string", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardMarkup", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyM...
// SendPhotoWithKeyboard send a photo with explicit Keyboard
[ "SendPhotoWithKeyboard", "send", "a", "photo", "with", "explicit", "Keyboard" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L210-L213
151,873
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendPhotoWithForceReply
func (bot TgBot) SendPhotoWithForceReply(cid int, photo interface{}, caption *string, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendPhoto(cid, photo, caption, rmi, &rkm) }
go
func (bot TgBot) SendPhotoWithForceReply(cid int, photo interface{}, caption *string, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendPhoto(cid, photo, caption, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendPhotoWithForceReply", "(", "cid", "int", ",", "photo", "interface", "{", "}", ",", "caption", "*", "string", ",", "rmi", "*", "int", ",", "rm", "ForceReply", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupIn...
// SendPhotoWithForceReply send a photo with explicit Force Reply.
[ "SendPhotoWithForceReply", "send", "a", "photo", "with", "explicit", "Force", "Reply", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L216-L219
151,874
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendPhotoWithKeyboardHide
func (bot TgBot) SendPhotoWithKeyboardHide(cid int, photo interface{}, caption *string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendPhoto(cid, photo, caption, rmi, &rkm) }
go
func (bot TgBot) SendPhotoWithKeyboardHide(cid int, photo interface{}, caption *string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendPhoto(cid, photo, caption, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendPhotoWithKeyboardHide", "(", "cid", "int", ",", "photo", "interface", "{", "}", ",", "caption", "*", "string", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardHide", ")", "ResultWithMessage", "{", "var", "rkm", "Repl...
// SendPhotoWithKeyboardHide send a photo with explicit Keyboard Hide.
[ "SendPhotoWithKeyboardHide", "send", "a", "photo", "with", "explicit", "Keyboard", "Hide", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L222-L225
151,875
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendPhoto
func (bot TgBot) SendPhoto(cid int, photo interface{}, caption *string, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { payload, err := bot.imageInterfaceToType(cid, photo, caption, rmi, rm) if err != nil { errc := 500 errs := err.Error() return ResultWithMessage{ResultBase{false, &errc, &errs}, nil} } return bot.SendPhotoQuery(payload) }
go
func (bot TgBot) SendPhoto(cid int, photo interface{}, caption *string, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { payload, err := bot.imageInterfaceToType(cid, photo, caption, rmi, rm) if err != nil { errc := 500 errs := err.Error() return ResultWithMessage{ResultBase{false, &errc, &errs}, nil} } return bot.SendPhotoQuery(payload) }
[ "func", "(", "bot", "TgBot", ")", "SendPhoto", "(", "cid", "int", ",", "photo", "interface", "{", "}", ",", "caption", "*", "string", ",", "rmi", "*", "int", ",", "rm", "*", "ReplyMarkupInt", ")", "ResultWithMessage", "{", "payload", ",", "err", ":=", ...
// SendPhoto full function wrapper for sendPhoto, use the markup interface.
[ "SendPhoto", "full", "function", "wrapper", "for", "sendPhoto", "use", "the", "markup", "interface", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L228-L236
151,876
rockneurotiko/go-tgbot
tgbot-apicalls.go
SimpleSendAudio
func (bot TgBot) SimpleSendAudio(msg Message, audio string) (res Message, err error) { cid := msg.Chat.ID var payload interface{} = SendAudioIDQuery{cid, audio, nil, nil, nil, nil, nil} if looksLikePath(audio) { payload = SendAudioPathQuery{cid, audio, nil, nil, nil, nil, nil} } ressm := bot.SendAudioQuery(payload) return splitResultInMessageError(ressm) }
go
func (bot TgBot) SimpleSendAudio(msg Message, audio string) (res Message, err error) { cid := msg.Chat.ID var payload interface{} = SendAudioIDQuery{cid, audio, nil, nil, nil, nil, nil} if looksLikePath(audio) { payload = SendAudioPathQuery{cid, audio, nil, nil, nil, nil, nil} } ressm := bot.SendAudioQuery(payload) return splitResultInMessageError(ressm) }
[ "func", "(", "bot", "TgBot", ")", "SimpleSendAudio", "(", "msg", "Message", ",", "audio", "string", ")", "(", "res", "Message", ",", "err", "error", ")", "{", "cid", ":=", "msg", ".", "Chat", ".", "ID", "\n", "var", "payload", "interface", "{", "}", ...
// Audio!! // SimpleSendAudio send just an audio
[ "Audio!!", "SimpleSendAudio", "send", "just", "an", "audio" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L278-L286
151,877
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendAudioWithKeyboard
func (bot TgBot) SendAudioWithKeyboard(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendAudio(cid, audio, duration, performer, title, rmi, &rkm) }
go
func (bot TgBot) SendAudioWithKeyboard(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendAudio(cid, audio, duration, performer, title, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendAudioWithKeyboard", "(", "cid", "int", ",", "audio", "string", ",", "duration", "*", "int", ",", "performer", "*", "string", ",", "title", "*", "string", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardMarkup", ")"...
// SendAudioWithKeyboard send a audio with explicit Keyboard
[ "SendAudioWithKeyboard", "send", "a", "audio", "with", "explicit", "Keyboard" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L289-L292
151,878
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendAudioWithForceReply
func (bot TgBot) SendAudioWithForceReply(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendAudio(cid, audio, duration, performer, title, rmi, &rkm) }
go
func (bot TgBot) SendAudioWithForceReply(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendAudio(cid, audio, duration, performer, title, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendAudioWithForceReply", "(", "cid", "int", ",", "audio", "string", ",", "duration", "*", "int", ",", "performer", "*", "string", ",", "title", "*", "string", ",", "rmi", "*", "int", ",", "rm", "ForceReply", ")", "Re...
// SendAudioWithForceReply send a audio with explicit Force Reply.
[ "SendAudioWithForceReply", "send", "a", "audio", "with", "explicit", "Force", "Reply", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L295-L298
151,879
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendAudioWithKeyboardHide
func (bot TgBot) SendAudioWithKeyboardHide(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendAudio(cid, audio, duration, performer, title, rmi, &rkm) }
go
func (bot TgBot) SendAudioWithKeyboardHide(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendAudio(cid, audio, duration, performer, title, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendAudioWithKeyboardHide", "(", "cid", "int", ",", "audio", "string", ",", "duration", "*", "int", ",", "performer", "*", "string", ",", "title", "*", "string", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardHide", "...
// SendAudioWithKeyboardHide send a audio with explicit Keyboard Hide.
[ "SendAudioWithKeyboardHide", "send", "a", "audio", "with", "explicit", "Keyboard", "Hide", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L301-L304
151,880
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendAudio
func (bot TgBot) SendAudio(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { var payload interface{} = SendAudioIDQuery{cid, audio, duration, performer, title, rmi, rm} if looksLikePath(audio) { payload = SendAudioPathQuery{cid, audio, duration, performer, title, rmi, rm} } return bot.SendAudioQuery(payload) }
go
func (bot TgBot) SendAudio(cid int, audio string, duration *int, performer *string, title *string, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { var payload interface{} = SendAudioIDQuery{cid, audio, duration, performer, title, rmi, rm} if looksLikePath(audio) { payload = SendAudioPathQuery{cid, audio, duration, performer, title, rmi, rm} } return bot.SendAudioQuery(payload) }
[ "func", "(", "bot", "TgBot", ")", "SendAudio", "(", "cid", "int", ",", "audio", "string", ",", "duration", "*", "int", ",", "performer", "*", "string", ",", "title", "*", "string", ",", "rmi", "*", "int", ",", "rm", "*", "ReplyMarkupInt", ")", "Resul...
// SendAudio full function to send an audio. Uses the reply markup interface.
[ "SendAudio", "full", "function", "to", "send", "an", "audio", ".", "Uses", "the", "reply", "markup", "interface", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L307-L313
151,881
rockneurotiko/go-tgbot
tgbot-apicalls.go
SimpleSendVoice
func (bot TgBot) SimpleSendVoice(msg Message, audio string) (res Message, err error) { cid := msg.Chat.ID var payload interface{} = SendVoiceIDQuery{cid, audio, nil, nil, nil} if looksLikePath(audio) { payload = SendVoicePathQuery{cid, audio, nil, nil, nil} } ressm := bot.SendVoiceQuery(payload) return splitResultInMessageError(ressm) }
go
func (bot TgBot) SimpleSendVoice(msg Message, audio string) (res Message, err error) { cid := msg.Chat.ID var payload interface{} = SendVoiceIDQuery{cid, audio, nil, nil, nil} if looksLikePath(audio) { payload = SendVoicePathQuery{cid, audio, nil, nil, nil} } ressm := bot.SendVoiceQuery(payload) return splitResultInMessageError(ressm) }
[ "func", "(", "bot", "TgBot", ")", "SimpleSendVoice", "(", "msg", "Message", ",", "audio", "string", ")", "(", "res", "Message", ",", "err", "error", ")", "{", "cid", ":=", "msg", ".", "Chat", ".", "ID", "\n", "var", "payload", "interface", "{", "}", ...
// Voice!! // SimpleSendVoice send just an audio
[ "Voice!!", "SimpleSendVoice", "send", "just", "an", "audio" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L323-L331
151,882
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendVoiceWithKeyboard
func (bot TgBot) SendVoiceWithKeyboard(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVoice(cid, audio, duration, rmi, &rkm) }
go
func (bot TgBot) SendVoiceWithKeyboard(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVoice(cid, audio, duration, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendVoiceWithKeyboard", "(", "cid", "int", ",", "audio", "string", ",", "duration", "*", "int", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardMarkup", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=", ...
// SendVoiceWithKeyboard send a audio with explicit Keyboard
[ "SendVoiceWithKeyboard", "send", "a", "audio", "with", "explicit", "Keyboard" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L334-L337
151,883
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendVoiceWithForceReply
func (bot TgBot) SendVoiceWithForceReply(cid int, audio string, duration *int, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVoice(cid, audio, duration, rmi, &rkm) }
go
func (bot TgBot) SendVoiceWithForceReply(cid int, audio string, duration *int, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVoice(cid, audio, duration, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendVoiceWithForceReply", "(", "cid", "int", ",", "audio", "string", ",", "duration", "*", "int", ",", "rmi", "*", "int", ",", "rm", "ForceReply", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=", "rm", ...
// SendVoiceWithForceReply send a audio with explicit Force Reply.
[ "SendVoiceWithForceReply", "send", "a", "audio", "with", "explicit", "Force", "Reply", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L340-L343
151,884
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendVoiceWithKeyboardHide
func (bot TgBot) SendVoiceWithKeyboardHide(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVoice(cid, audio, duration, rmi, &rkm) }
go
func (bot TgBot) SendVoiceWithKeyboardHide(cid int, audio string, duration *int, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVoice(cid, audio, duration, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendVoiceWithKeyboardHide", "(", "cid", "int", ",", "audio", "string", ",", "duration", "*", "int", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardHide", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=",...
// SendVoiceWithKeyboardHide send a audio with explicit Keyboard Hide.
[ "SendVoiceWithKeyboardHide", "send", "a", "audio", "with", "explicit", "Keyboard", "Hide", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L346-L349
151,885
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendVoice
func (bot TgBot) SendVoice(cid int, audio string, duration *int, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { var payload interface{} = SendVoiceIDQuery{cid, audio, duration, rmi, rm} if looksLikePath(audio) { payload = SendVoicePathQuery{cid, audio, nil, rmi, rm} } return bot.SendVoiceQuery(payload) }
go
func (bot TgBot) SendVoice(cid int, audio string, duration *int, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { var payload interface{} = SendVoiceIDQuery{cid, audio, duration, rmi, rm} if looksLikePath(audio) { payload = SendVoicePathQuery{cid, audio, nil, rmi, rm} } return bot.SendVoiceQuery(payload) }
[ "func", "(", "bot", "TgBot", ")", "SendVoice", "(", "cid", "int", ",", "audio", "string", ",", "duration", "*", "int", ",", "rmi", "*", "int", ",", "rm", "*", "ReplyMarkupInt", ")", "ResultWithMessage", "{", "var", "payload", "interface", "{", "}", "="...
// SendVoice full function to send an audio. Uses the reply markup interface.
[ "SendVoice", "full", "function", "to", "send", "an", "audio", ".", "Uses", "the", "reply", "markup", "interface", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L352-L358
151,886
rockneurotiko/go-tgbot
tgbot-apicalls.go
SimpleSendDocument
func (bot TgBot) SimpleSendDocument(msg Message, document string) (res Message, err error) { cid := msg.Chat.ID var payload interface{} = SendDocumentIDQuery{cid, document, nil, nil} if looksLikePath(document) { payload = SendDocumentPathQuery{cid, document, nil, nil} } ressm := bot.SendDocumentQuery(payload) return splitResultInMessageError(ressm) }
go
func (bot TgBot) SimpleSendDocument(msg Message, document string) (res Message, err error) { cid := msg.Chat.ID var payload interface{} = SendDocumentIDQuery{cid, document, nil, nil} if looksLikePath(document) { payload = SendDocumentPathQuery{cid, document, nil, nil} } ressm := bot.SendDocumentQuery(payload) return splitResultInMessageError(ressm) }
[ "func", "(", "bot", "TgBot", ")", "SimpleSendDocument", "(", "msg", "Message", ",", "document", "string", ")", "(", "res", "Message", ",", "err", "error", ")", "{", "cid", ":=", "msg", ".", "Chat", ".", "ID", "\n", "var", "payload", "interface", "{", ...
//Documents!! // SimpleSendDocument send just a document.
[ "Documents!!", "SimpleSendDocument", "send", "just", "a", "document", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L368-L376
151,887
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendDocumentWithKeyboard
func (bot TgBot) SendDocumentWithKeyboard(cid int, document string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendDocument(cid, document, rmi, &rkm) }
go
func (bot TgBot) SendDocumentWithKeyboard(cid int, document string, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendDocument(cid, document, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendDocumentWithKeyboard", "(", "cid", "int", ",", "document", "string", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardMarkup", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=", "rm", "\n", "return", "b...
// SendDocumentWithKeyboard send a document with explicit keyboard.
[ "SendDocumentWithKeyboard", "send", "a", "document", "with", "explicit", "keyboard", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L379-L382
151,888
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendDocumentWithForceReply
func (bot TgBot) SendDocumentWithForceReply(cid int, document string, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendDocument(cid, document, rmi, &rkm) }
go
func (bot TgBot) SendDocumentWithForceReply(cid int, document string, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendDocument(cid, document, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendDocumentWithForceReply", "(", "cid", "int", ",", "document", "string", ",", "rmi", "*", "int", ",", "rm", "ForceReply", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=", "rm", "\n", "return", "bot", ...
// SendDocumentWithForceReply send a document with explicit force reply
[ "SendDocumentWithForceReply", "send", "a", "document", "with", "explicit", "force", "reply" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L385-L388
151,889
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendDocumentWithKeyboardHide
func (bot TgBot) SendDocumentWithKeyboardHide(cid int, document string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendDocument(cid, document, rmi, &rkm) }
go
func (bot TgBot) SendDocumentWithKeyboardHide(cid int, document string, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendDocument(cid, document, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendDocumentWithKeyboardHide", "(", "cid", "int", ",", "document", "string", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardHide", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=", "rm", "\n", "return", ...
// SendDocumentWithKeyboardHide send a document with explicit keyboard hide.
[ "SendDocumentWithKeyboardHide", "send", "a", "document", "with", "explicit", "keyboard", "hide", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L391-L394
151,890
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendDocument
func (bot TgBot) SendDocument(cid int, document interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { payload, err := bot.documentInterfaceToType(cid, document, rmi, rm) if err != nil { errc := 500 errs := err.Error() return ResultWithMessage{ResultBase{false, &errc, &errs}, nil} } // var payload interface{} = SendDocumentIDQuery{cid, document, rmi, rm} // if looksLikePath(document) { // payload = SendDocumentPathQuery{cid, document, rmi, rm} // } return bot.SendDocumentQuery(payload) }
go
func (bot TgBot) SendDocument(cid int, document interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { payload, err := bot.documentInterfaceToType(cid, document, rmi, rm) if err != nil { errc := 500 errs := err.Error() return ResultWithMessage{ResultBase{false, &errc, &errs}, nil} } // var payload interface{} = SendDocumentIDQuery{cid, document, rmi, rm} // if looksLikePath(document) { // payload = SendDocumentPathQuery{cid, document, rmi, rm} // } return bot.SendDocumentQuery(payload) }
[ "func", "(", "bot", "TgBot", ")", "SendDocument", "(", "cid", "int", ",", "document", "interface", "{", "}", ",", "rmi", "*", "int", ",", "rm", "*", "ReplyMarkupInt", ")", "ResultWithMessage", "{", "payload", ",", "err", ":=", "bot", ".", "documentInterf...
// SendDocument full function to send document, uses the reply markup interface.
[ "SendDocument", "full", "function", "to", "send", "document", "uses", "the", "reply", "markup", "interface", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L397-L409
151,891
rockneurotiko/go-tgbot
tgbot-apicalls.go
SimpleSendSticker
func (bot TgBot) SimpleSendSticker(msg Message, sticker interface{}) (res Message, err error) { cid := msg.Chat.ID ressm := bot.SendSticker(cid, sticker, nil, nil) return splitResultInMessageError(ressm) }
go
func (bot TgBot) SimpleSendSticker(msg Message, sticker interface{}) (res Message, err error) { cid := msg.Chat.ID ressm := bot.SendSticker(cid, sticker, nil, nil) return splitResultInMessageError(ressm) }
[ "func", "(", "bot", "TgBot", ")", "SimpleSendSticker", "(", "msg", "Message", ",", "sticker", "interface", "{", "}", ")", "(", "res", "Message", ",", "err", "error", ")", "{", "cid", ":=", "msg", ".", "Chat", ".", "ID", "\n", "ressm", ":=", "bot", ...
// Stickers!!! // SimpleSendSticker just send a sticker!!
[ "Stickers!!!", "SimpleSendSticker", "just", "send", "a", "sticker!!" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L476-L480
151,892
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendStickerWithKeyboard
func (bot TgBot) SendStickerWithKeyboard(cid int, sticker interface{}, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendSticker(cid, sticker, rmi, &rkm) }
go
func (bot TgBot) SendStickerWithKeyboard(cid int, sticker interface{}, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendSticker(cid, sticker, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendStickerWithKeyboard", "(", "cid", "int", ",", "sticker", "interface", "{", "}", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardMarkup", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=", "rm", "\n", ...
// SendStickerWithKeyboard send a sticker with explicit keyboard.
[ "SendStickerWithKeyboard", "send", "a", "sticker", "with", "explicit", "keyboard", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L483-L486
151,893
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendStickerWithForceReply
func (bot TgBot) SendStickerWithForceReply(cid int, sticker interface{}, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendSticker(cid, sticker, rmi, &rkm) }
go
func (bot TgBot) SendStickerWithForceReply(cid int, sticker interface{}, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendSticker(cid, sticker, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendStickerWithForceReply", "(", "cid", "int", ",", "sticker", "interface", "{", "}", ",", "rmi", "*", "int", ",", "rm", "ForceReply", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=", "rm", "\n", "retur...
// SendStickerWithForceReply send a sticker with explicit force reply.
[ "SendStickerWithForceReply", "send", "a", "sticker", "with", "explicit", "force", "reply", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L489-L492
151,894
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendStickerWithKeyboardHide
func (bot TgBot) SendStickerWithKeyboardHide(cid int, sticker interface{}, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendSticker(cid, sticker, rmi, &rkm) }
go
func (bot TgBot) SendStickerWithKeyboardHide(cid int, sticker interface{}, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendSticker(cid, sticker, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendStickerWithKeyboardHide", "(", "cid", "int", ",", "sticker", "interface", "{", "}", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardHide", ")", "ResultWithMessage", "{", "var", "rkm", "ReplyMarkupInt", "=", "rm", "\n",...
// SendStickerWithKeyboardHide send a sticker with explicit keyboad hide.
[ "SendStickerWithKeyboardHide", "send", "a", "sticker", "with", "explicit", "keyboad", "hide", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L495-L498
151,895
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendSticker
func (bot TgBot) SendSticker(cid int, sticker interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { payload, err := bot.stickerInterfaceToType(cid, sticker, rmi, rm) if err != nil { errc := 500 errs := err.Error() return ResultWithMessage{ResultBase{false, &errc, &errs}, nil} } return bot.SendStickerQuery(payload) }
go
func (bot TgBot) SendSticker(cid int, sticker interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage { payload, err := bot.stickerInterfaceToType(cid, sticker, rmi, rm) if err != nil { errc := 500 errs := err.Error() return ResultWithMessage{ResultBase{false, &errc, &errs}, nil} } return bot.SendStickerQuery(payload) }
[ "func", "(", "bot", "TgBot", ")", "SendSticker", "(", "cid", "int", ",", "sticker", "interface", "{", "}", ",", "rmi", "*", "int", ",", "rm", "*", "ReplyMarkupInt", ")", "ResultWithMessage", "{", "payload", ",", "err", ":=", "bot", ".", "stickerInterface...
// SendSticker full function to send a sticker, uses reply markup interface.
[ "SendSticker", "full", "function", "to", "send", "a", "sticker", "uses", "reply", "markup", "interface", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L501-L509
151,896
rockneurotiko/go-tgbot
tgbot-apicalls.go
SimpleSendVideo
func (bot TgBot) SimpleSendVideo(msg Message, photo string) (res Message, err error) { cid := msg.Chat.ID var payload interface{} = SendVideoIDQuery{cid, photo, nil, nil, nil, nil} if looksLikePath(photo) { payload = SendVideoPathQuery{cid, photo, nil, nil, nil, nil} } ressm := bot.SendVideoQuery(payload) return splitResultInMessageError(ressm) }
go
func (bot TgBot) SimpleSendVideo(msg Message, photo string) (res Message, err error) { cid := msg.Chat.ID var payload interface{} = SendVideoIDQuery{cid, photo, nil, nil, nil, nil} if looksLikePath(photo) { payload = SendVideoPathQuery{cid, photo, nil, nil, nil, nil} } ressm := bot.SendVideoQuery(payload) return splitResultInMessageError(ressm) }
[ "func", "(", "bot", "TgBot", ")", "SimpleSendVideo", "(", "msg", "Message", ",", "photo", "string", ")", "(", "res", "Message", ",", "err", "error", ")", "{", "cid", ":=", "msg", ".", "Chat", ".", "ID", "\n", "var", "payload", "interface", "{", "}", ...
// Send video!!!! // SimpleSendVideo just send a video from file path or id
[ "Send", "video!!!!", "SimpleSendVideo", "just", "send", "a", "video", "from", "file", "path", "or", "id" ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L539-L547
151,897
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendVideoWithKeyboard
func (bot TgBot) SendVideoWithKeyboard(cid int, photo string, caption *string, duration *int, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVideo(cid, photo, caption, duration, rmi, &rkm) }
go
func (bot TgBot) SendVideoWithKeyboard(cid int, photo string, caption *string, duration *int, rmi *int, rm ReplyKeyboardMarkup) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVideo(cid, photo, caption, duration, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendVideoWithKeyboard", "(", "cid", "int", ",", "photo", "string", ",", "caption", "*", "string", ",", "duration", "*", "int", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardMarkup", ")", "ResultWithMessage", "{", "var"...
// SendVideoWithKeyboard send a video with explicit keyboard.
[ "SendVideoWithKeyboard", "send", "a", "video", "with", "explicit", "keyboard", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L550-L553
151,898
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendVideoWithForceReply
func (bot TgBot) SendVideoWithForceReply(cid int, photo string, caption *string, duration *int, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVideo(cid, photo, caption, duration, rmi, &rkm) }
go
func (bot TgBot) SendVideoWithForceReply(cid int, photo string, caption *string, duration *int, rmi *int, rm ForceReply) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVideo(cid, photo, caption, duration, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendVideoWithForceReply", "(", "cid", "int", ",", "photo", "string", ",", "caption", "*", "string", ",", "duration", "*", "int", ",", "rmi", "*", "int", ",", "rm", "ForceReply", ")", "ResultWithMessage", "{", "var", "rk...
// SendVideoWithForceReply send a video with explicit force reply.
[ "SendVideoWithForceReply", "send", "a", "video", "with", "explicit", "force", "reply", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L556-L559
151,899
rockneurotiko/go-tgbot
tgbot-apicalls.go
SendVideoWithKeyboardHide
func (bot TgBot) SendVideoWithKeyboardHide(cid int, photo string, caption *string, duration *int, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVideo(cid, photo, caption, duration, rmi, &rkm) }
go
func (bot TgBot) SendVideoWithKeyboardHide(cid int, photo string, caption *string, duration *int, rmi *int, rm ReplyKeyboardHide) ResultWithMessage { var rkm ReplyMarkupInt = rm return bot.SendVideo(cid, photo, caption, duration, rmi, &rkm) }
[ "func", "(", "bot", "TgBot", ")", "SendVideoWithKeyboardHide", "(", "cid", "int", ",", "photo", "string", ",", "caption", "*", "string", ",", "duration", "*", "int", ",", "rmi", "*", "int", ",", "rm", "ReplyKeyboardHide", ")", "ResultWithMessage", "{", "va...
// SendVideoWithKeyboardHide send a video with explici keyboard hide.
[ "SendVideoWithKeyboardHide", "send", "a", "video", "with", "explici", "keyboard", "hide", "." ]
50ec5924e3c134ff1c34efd5d8fe9057c67790b7
https://github.com/rockneurotiko/go-tgbot/blob/50ec5924e3c134ff1c34efd5d8fe9057c67790b7/tgbot-apicalls.go#L562-L565