MCPcopy Create free account

hub / github.com/PacktPublishing/Go-Programming-Cookbook-Second-Edition / functions

Functions795 in github.com/PacktPublishing/Go-Programming-Cookbook-Second-Edition

↓ 38 callersMethodClose
()
chapter13/firebase/client.go:14
↓ 32 callersMethodError
Error implements the error interface
chapter10/waitgroup/tasks.go:32
↓ 19 callersMethodGet
(ctx context.Context, key string)
chapter13/firebase/client.go:12
↓ 18 callersMethodExec
(query string, args ...interface{})
chapter6/dbinterface/transaction.go:8
↓ 18 callersFunctionclientError
clientError adds consistency to errors generated in the client
chapter7/twirp/rpc/greeter/greeter.twirp.go:582
↓ 17 callersMethodwriteError
writeError writes an HTTP response with a valid Twirp error format, and triggers hooks. If err is not a twirp.Error, it will get wrapped with twirp.In
chapter7/twirp/rpc/greeter/greeter.twirp.go:137
↓ 14 callersMethodString
We can use this to print the lookup object
chapter5/dns/dns.go:17
↓ 12 callersMethodAdd
Add increments the counter
chapter14/bench/lock.go:13
↓ 11 callersMethodDecode
Decode will decode into TOMLData
chapter2/confformat/yaml.go:30
↓ 11 callersMethodSet
(ctx context.Context, key string, value interface{})
chapter13/firebase/client.go:13
↓ 11 callersMethodString
()
chapter2/ansicolor/color.go:35
↓ 8 callersMethodSetup
Setup initializes a config from flags that are passed in
chapter2/flags/flags.go:18
↓ 7 callersMethodDo
(req *http.Request)
chapter7/twirp/rpc/greeter/greeter.twirp.go:343
↓ 6 callersMethodGetToken
()
chapter7/oauthstore/storage.go:12
↓ 6 callersMethodRead
Read returns the current counter amount
chapter14/bench/lock.go:20
↓ 6 callersMethodSet
(ctx context.Context, in *SetKeyValueRequest, opts ...grpc.CallOption)
chapter8/grpcjson/keyvalue/keyvalue.pb.go:119
↓ 6 callersMethodSet
(key, val string)
chapter9/mockgen/interface.go:6
↓ 6 callersMethodTokenSource
TokenSource can be passed a token which is stored, or when a new one is retrieved, that's stored
chapter7/oauthstore/config.go:32
↓ 6 callersFunctionwrapErr
(err error, msg string)
chapter7/twirp/rpc/greeter/greeter.twirp.go:577
↓ 5 callersMethodAdd
Add adds another error
chapter10/waitgroup/tasks.go:27
↓ 5 callersMethodClient
Client is attached to our TokenSource
chapter7/oauthstore/config.go:37
↓ 4 callersFunctionCheckType
CheckType will print based on the interface type
chapter3/dataconv/interfaces.go:7
↓ 4 callersFunctionCreateTemplate
CreateTemplate will creat a template file that contains data
chapter1/templates/template_files.go:11
↓ 4 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use
chapter9/mockgen/internal/mocks.go:31
↓ 4 callersMethodEncode
Encode takes plain text as int and returns "string => <base64 string encoding> as out
chapter10/pipeline/encode.go:12
↓ 4 callersMethodError
()
chapter4/basicerrors/custom.go:13
↓ 4 callersMethodGet
()
chapter8/controllers/storage.go:6
↓ 4 callersMethodGet
(ctx context.Context, in *GetKeyValueRequest, opts ...grpc.CallOption)
chapter8/grpcjson/keyvalue/keyvalue.pb.go:120
↓ 4 callersMethodGet
(key string)
chapter9/mockgen/interface.go:7
↓ 4 callersMethodGreet
(context.Context, *GreetRequest)
chapter7/twirp/rpc/greeter/greeter.twirp.go:36
↓ 4 callersMethodGreet
(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption)
chapter7/grpc/greeter/greeter.pb.go:93
↓ 4 callersMethodPrint
Print prints w.in and repalys it on w.out
chapter10/pipeline/print.go:10
↓ 4 callersMethodPut
(context.Context, *Item)
chapter6/storage/storage.go:17
↓ 4 callersMethodQuery
(query string, args ...interface{})
chapter6/dbinterface/transaction.go:10
↓ 4 callersMethodSetHandler
SetHandler wraps or GRPC Set
chapter8/grpcjson/http/set.go:18
↓ 4 callersFunctionThrowError
ThrowError throws an error that we'll trace
chapter4/structured/apex.go:12
↓ 4 callersFunctionWrappedError
WrappedError demonstrates error wrapping and annotating an error
chapter4/errwrap/errwrap.go:11
↓ 4 callersFunctionconcat
(vals ...string)
chapter14/tuning/concat.go:3
↓ 4 callersFunctionjoin
(vals ...string)
chapter14/tuning/join.go:5
↓ 3 callersMethodAdd
Add increments the counter
chapter14/bench/atomic.go:12
↓ 3 callersFunctionDeSerializeStructStrings
DeSerializeStructStrings converts a serialized string using our custom serialization format to a struct
chapter3/tags/deserialize.go:12
↓ 3 callersMethodDecode
Decode will decode into JSONData
chapter2/confformat/json.go:30
↓ 3 callersMethodDoOps
DoOps with a controller object
chapter7/client/store.go:15
↓ 3 callersMethodError
()
chapter7/twirp/rpc/greeter/greeter.twirp.go:579
↓ 3 callersMethodExchange
Exchange stores a token after retrieval
chapter7/oauthstore/config.go:18
↓ 3 callersFunctionGetID
GetID grabs an ID from a context if set otherwise it returns an empty string
chapter8/middleware/context.go:31
↓ 3 callersMethodGetOrdinal
GetOrdinal will return the current ordinal
chapter10/atomic/ordinal.go:31
↓ 3 callersFunctionGetValue
GetValue grabs a value given a key and returns a string representation of the value
chapter10/context/values.go:24
↓ 3 callersMethodGetValue
GetValue is a closure that wraps a HandlerFunc, if UseDefault is true value will always be "default" else it'll be whatever is stored in storage
chapter8/controllers/get.go:11
↓ 3 callersFunctionNew
New is a Controller 'constructor'
chapter8/controllers/controller.go:9
↓ 3 callersFunctionNewAPIClient
NewAPIClient constructor initializes the client with our custom Transport
chapter7/rest/client.go:12
↓ 3 callersFunctionNewClient
NewClient creates a new client and sets its appropriate channels
chapter7/async/config.go:6
↓ 3 callersFunctionNewClient
NewClient iniitalizes a consul client
chapter11/discovery/client.go:20
↓ 3 callersMethodRead
Read returns the current counter amount
chapter14/bench/atomic.go:17
↓ 3 callersMethodRegister
(tags []string)
chapter11/discovery/client.go:8
↓ 3 callersMethodRoundTrip
RoundTrip just calls the original function
chapter7/decorator/decorator.go:9
↓ 3 callersFunctionSerializeStructStrings
SerializeStructStrings converts a struct to our custom serialization format it honors serialize struct tags for string types
chapter3/tags/serialize.go:8
↓ 3 callersMethodService
(service, tag string)
chapter11/discovery/client.go:9
↓ 3 callersMethodSet
Set uses a write lock and sets the value given a key
chapter10/atomic/map.go:22
↓ 3 callersMethodSetToken
(*oauth2.Token)
chapter7/oauthstore/storage.go:13
↓ 3 callersFunctionSetup
Setup configures our client and redefines the global DefaultClient
chapter7/client/client.go:10
↓ 3 callersFunctionSetup
Setup initializes a redis client
chapter6/redis/config.go:10
↓ 3 callersFunctionStorageTokenSource
StorageTokenSource will be used by our config.TokenSource method
chapter7/oauthstore/tokensource.go:30
↓ 3 callersMethodToCSV
ToCSV takes a set of Books and writes to an io.Writer it returns any errors
chapter1/csvformat/write_csv.go:21
↓ 3 callersFunctionbadRouteError
badRouteError is used when the twirp server cannot route a request
chapter7/twirp/rpc/greeter/greeter.twirp.go:587
↓ 3 callersFunctioncallError
Call twirp.ServerHooks.Error if the hook is available
chapter7/twirp/rpc/greeter/greeter.twirp.go:743
↓ 3 callersFunctioncallResponseSent
Call twirp.ServerHooks.ResponseSent if the hook is available
chapter7/twirp/rpc/greeter/greeter.twirp.go:735
↓ 3 callersFunctiongetFields
(ctx context.Context)
chapter4/context/log.go:15
↓ 3 callersFunctionisHTTPRedirect
(status int)
chapter7/twirp/rpc/greeter/greeter.twirp.go:566
↓ 2 callersFunctionAddItem
AddItem adds an item to our list in a thread-safe way
chapter14/fastweb/items.go:16
↓ 2 callersMethodApply
Apply updates our FSM
chapter11/consensus/fsm.go:22
↓ 2 callersMethodAsyncGet
AsyncGet performs a Get then returns the resp/error to the appropriate channel
chapter7/async/config.go:26
↓ 2 callersFunctionBasicAuth
BasicAuth is another of our 'middleware' decorators
chapter7/decorator/middleware.go:23
↓ 2 callersFunctionBuffer
Buffer demonstrates some tricks for initializing bytes Buffers These buffers implement an io.Reader interface
chapter1/bytestrings/buffer.go:11
↓ 2 callersMethodCanTransition
CanTransition checks if a new state is valid
chapter11/consensus/state.go:22
↓ 2 callersFunctionCapitalizer
Capitalizer opens a file, reads the contents, then writes those contents to a second file
chapter1/filedirs/files.go:12
↓ 2 callersFunctionCardType
CardType returns our card graphql object
chapter12/graphql/cards/type.go:6
↓ 2 callersFunctionCatchSig
CatchSig sets up a listener for SIGINT interrupts
chapter2/signals/signals.go:12
↓ 2 callersFunctionCopyResponse
CopyResponse takes the client response and writes everything to the ResponseWriter in the original handler
chapter8/proxy/process.go:26
↓ 2 callersFunctionCreate
Create makes a table called example and populates it
chapter6/database/create.go:11
↓ 2 callersFunctionCreate
we import supported libraries for database/sql Create makes a table called example and populates it
chapter6/dbinterface/create.go:7
↓ 2 callersFunctionDebug
Debug exports the logs Debug connected to our global log
chapter4/global/global.go:46
↓ 2 callersMethodDecode
Decode will decode into TOMLData
chapter2/confformat/toml.go:29
↓ 2 callersFunctionDecorate
Decorate is a helper to wrap all the middleware
chapter7/decorator/decorator.go:18
↓ 2 callersMethodEXPECT
()
chapter12/asynckafka/producer/mocks_test.go:28
↓ 2 callersMethodEXPECT
()
chapter6/dbinterface/mocks_test.go:29
↓ 2 callersMethodErrors
()
chapter12/asynckafka/producer/mocks_test.go:50
↓ 2 callersMethodGet
Get mocks base method
chapter9/mockgen/internal/mocks.go:36
↓ 2 callersMethodGet
Get uses a RW lock and gets the value if it exists, otherwise an error is returned
chapter10/atomic/map.go:31
↓ 2 callersMethodGetGoogle
GetGoogle is an API Call - we abstract away the REST aspects
chapter7/rest/client.go:27
↓ 2 callersMethodGetKey
()
chapter8/grpcjson/keyvalue/keyvalue.pb.go:48
↓ 2 callersMethodGetMessage
GetMessage uses all of the internal config vars and returns a sentence
chapter2/flags/flags.go:37
↓ 2 callersFunctionGetNegotiator
GetNegotiator takes a request, and figures out the ContentType from the Content-Type header
chapter8/negotiate/negotiate.go:18
↓ 2 callersMethodGetSubMenu
GetSubMenu return a flag set for a submenu
chapter2/cmdargs/cmdargs.go:47
↓ 2 callersFunctionGetURL
GetURL gets a url, and logs the time it took
chapter10/waitgroup/tasks.go:12
↓ 2 callersMethodGetValue
()
chapter8/grpcjson/keyvalue/keyvalue.pb.go:95
↓ 2 callersMethodGreet
Greet will be invoked by the greet command
chapter2/cmdargs/cmdargs.go:59
↓ 2 callersMethodHandler
Handler grabs a message from a GET parama and send it to the kafka queue asynchronously
chapter12/asynckafka/producer/handler.go:17
↓ 2 callersMethodIncrement
Increment will increment the current ordinal
chapter10/atomic/ordinal.go:37
↓ 2 callersFunctionInit
Init sets up the logger intially if run multiple times, it returns an error
chapter4/global/global.go:21
next →1–100 of 795, ranked by callers