Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ardanlabs/kit
/ functions
Functions
292 in github.com/ardanlabs/kit
⨍
Functions
292
◇
Types & classes
115
↓ 102 callers
Method
Log
Log returns a string to help with logging your configuration. It excludes any values whose key contains the string "PASS".
cfg/cfg.go:41
↓ 54 callers
Method
String
String returns the value of the given key as a string. It will return an error if key was not found.
cfg/cfg.go:57
↓ 40 callers
Method
Fatal
Fatal logs trace information for users and terminates the app.
log/log.go:101
↓ 30 callers
Function
Decode
Decode takes a map and uses reflection to convert it into the given Go native structure. val must be a pointer to a struct.
mapstructure/mapstructure.go:81
↓ 29 callers
Method
User
User logs trace information for users.
log/log.go:71
↓ 21 callers
Method
Error
Error logs trace information that are errors.
log/log.go:86
↓ 19 callers
Method
Dev
Dev logs trace information for developers.
log/log.go:56
↓ 17 callers
Method
Error
Error is implementing the error interface.
mapstructure/error.go:15
↓ 17 callers
Method
Int
Int returns the value of the given key as an int. It will return an error if the key was not found or the value can't be converted to an int.
cfg/cfg.go:95
↓ 12 callers
Method
Decode
Decode decodes the given raw interface to the target pointer specified by the configuration.
mapstructure/mapstructure.go:222
↓ 12 callers
Method
Event
Event fires events back to the user for important events.
tcp/tcp_config.go:59
↓ 11 callers
Function
NewDecoder
NewDecoder returns a new decoder for the given configuration. Once a decoder has been returned, the same configuration must not be used again.
mapstructure/mapstructure.go:164
↓ 10 callers
Method
Bool
Bool returns the bool value of a given key as a bool. It will return an error if the key was not found or the value can't be converted to a bool.
cfg/cfg.go:189
↓ 8 callers
Method
MustInt
MustInt returns the value of the given key as an int. It will panic if the key was not found or the value can't be converted to an int.
cfg/cfg.go:114
↓ 8 callers
Method
SetBool
SetBool adds or modifies the configuration for the specified key and value.
cfg/cfg.go:238
↓ 8 callers
Method
SetInt
SetInt adds or modifies the configuration for the specified key and value.
cfg/cfg.go:132
↓ 8 callers
Method
SetString
SetString adds or modifies the configuration for the specified key and value.
cfg/cfg.go:85
↓ 8 callers
Method
getKind
(val reflect.Value)
mapstructure/mapstructure.go:401
↓ 7 callers
Function
DecodePath
DecodePath takes a map and uses reflection to convert it into the given Go native structure. Tags are used to specify the mapping between fields in th
mapstructure/mapstructure.go:98
↓ 7 callers
Method
Duration
Duration returns the value of the given key as a Duration. It will return an error if the key was not found or the value can't be converted to a Durat
cfg/cfg.go:300
↓ 6 callers
Method
Addr
Addr returns the local listening network address.
udp/udp.go:226
↓ 6 callers
Method
ErrorOffset
ErrorOffset logs trace information that are errors with a offset option to expand the caller level.
log/log.go:151
↓ 6 callers
Method
Run
Run performs the execution of the specified job.
runner/runner.go:45
↓ 6 callers
Method
UserOffset
UserOffset logs trace information for users with a offset option to expand the caller level.
log/log.go:135
↓ 6 callers
Function
appendErrors
(errors []string, err error)
mapstructure/error.go:26
↓ 6 callers
Method
decode
Decodes an unknown data type into a specific reflection value.
mapstructure/mapstructure.go:325
↓ 6 callers
Function
displayLog
displayLog can be called at the end of a test or example. It only prints the log contents if the -test.v flag is set.
log/log_test.go:28
↓ 6 callers
Function
resetLog
resetLog can be called at the beginning of a test or example.
log/log_test.go:24
↓ 6 callers
Function
shouldNotPanic
shouldNotPanic receives a ctx string and a function to run, if the function panics, it is considered a failure else a success.
cfg/cfg_test.go:240
↓ 6 callers
Function
shouldPanic
shouldPanic receives a ctx string and a function to run, if the function panics, it is considered a success else a failure.
cfg/cfg_test.go:226
↓ 5 callers
Method
Addr
Addr returns the listener's network address. This may be different than the values provided in the configuration, for example if configuration port va
tcp/tcp.go:362
↓ 5 callers
Method
DecodePath
DecodePath decodes the raw interface against the map based on the specified tags
mapstructure/mapstructure.go:228
↓ 5 callers
Method
DevOffset
DevOffset logs trace information for developers with a offset option to expand the caller level.
log/log.go:119
↓ 5 callers
Method
Do
Do waits for the goroutine pool to take the work to be executed.
pool/pool.go:141
↓ 5 callers
Method
MustBool
MustBool returns the bool value of a given key as a bool. It will panic if the key was not found or the value can't be converted to a bool.
cfg/cfg.go:214
↓ 5 callers
Method
MustString
MustString returns the value of the given key as a string. It will panic if the key was not found.
cfg/cfg.go:71
↓ 5 callers
Function
RespondError
RespondError sends JSON describing the error
web/reponse.go:99
↓ 5 callers
Method
Stop
Stop shuts down the manager and closes all connections.
udp/udp.go:193
↓ 5 callers
Method
URL
URL returns the value of the given key as a URL. It will return an error if the key was not found or the value can't be converted to a URL.
cfg/cfg.go:253
↓ 4 callers
Function
DecodeSlicePath
DecodeSlicePath decodes a slice of maps against a slice of structures that contain specified tags
mapstructure/mapstructure.go:115
↓ 4 callers
Method
Header
Header implements the http.ResponseWriter interface and simply relays the request.
web/proxy.go:16
↓ 4 callers
Method
Kill
Kill will kill the Job method immediately.
runner/runner_test.go:41
↓ 4 callers
Method
KillAfter
KillAfter will kill the Job method after the specified duration.
runner/runner_test.go:52
↓ 4 callers
Method
MustTime
MustTime returns the value of the given key as a Time. It will panic if the key was not found or the value can't be converted to a Time.
cfg/cfg.go:161
↓ 4 callers
Method
Read
Read is provided a request and a user-defined reader for each client connection on its own routine. Read must read a full request and return the popul
tcp/handlers.go:48
↓ 4 callers
Method
Shutdown
Shutdown waits for all the workers to finish.
pool/pool.go:130
↓ 4 callers
Method
Start
Start begins to accept data.
udp/udp.go:80
↓ 4 callers
Method
Start
Start creates the accept routine and begins to accept connections.
tcp/tcp.go:112
↓ 4 callers
Method
Stop
Stop shuts down the manager and closes all connections.
tcp/tcp.go:231
↓ 4 callers
Method
Write
Write is provided the response to write and the user-defined writer.
tcp/handlers.go:59
↓ 3 callers
Method
Error
Error implments the error interface for CltError.
tcp/tcp.go:45
↓ 3 callers
Method
Event
Event fires events back to the user for important events.
udp/udp_config.go:50
↓ 3 callers
Method
Handle
Handle is our mechanism for mounting Handlers for a given HTTP verb and path pair, this makes for really easy, convenient routing.
web/web.go:109
↓ 3 callers
Method
MustDuration
MustDuration returns the value of the given key as a Duration. It will panic if the key was not found or the value can't be converted into a Duration.
cfg/cfg.go:319
↓ 3 callers
Method
MustURL
MustURL returns the value of the given key as a URL. It will panic if the key was not found or the value can't be converted to a URL.
cfg/cfg.go:272
↓ 3 callers
Method
Send
Send will deliver the response back to the client.
udp/udp.go:221
↓ 3 callers
Method
Temporary
()
tcp/tcp.go:172
↓ 3 callers
Method
Time
Time returns the value of the given key as a Time. It will return an error if the key was not found or the value can't be converted to a Time.
cfg/cfg.go:142
↓ 3 callers
Method
add
add creates routines to process work or sets a count for routines to terminate. NOTE: since our pools are auto-adjustable, we will not give the user a
pool/pool.go:193
↓ 3 callers
Method
drop
drop closes the client connection and read operation.
tcp/client.go:61
↓ 3 callers
Function
wrapMiddleware
wrapMiddleware wraps a handler with some middleware.
web/web.go:213
↓ 2 callers
Method
Bind
Bind is called to set the reader and writer.
tcp/handlers.go:33
↓ 2 callers
Method
FatalOffset
FatalOffset logs trace information for users and terminates the app with a offset expand the caller level.
log/log.go:167
↓ 2 callers
Function
NewPathDecoder
NewPathDecoder returns a new decoder for the given configuration. This is used to decode path specific structures
mapstructure/mapstructure.go:198
↓ 2 callers
Method
Process
Process is used to handle the processing of the request.
tcp/handlers.go:51
↓ 2 callers
Method
Provide
()
cfg/cfg.go:23
↓ 2 callers
Function
Respond
Respond sends JSON to the client. If code is StatusNoContent, v is expected to be nil.
web/reponse.go:105
↓ 2 callers
Method
SetDuration
SetDuration adds or modifies the configuration for a given duration at a specific key.
cfg/cfg.go:338
↓ 2 callers
Method
SetTime
SetTime adds or modifies the configuration for the specified key and value.
cfg/cfg.go:179
↓ 2 callers
Method
SetURL
SetURL adds or modifies the configuration for the specified key and value.
cfg/cfg.go:290
↓ 2 callers
Method
Stats
Stats returns the current snapshot of the pool stats.
pool/pool.go:179
↓ 2 callers
Method
WriteHeader
WriteHeader implements the http.ResponseWriter interface and simply relays the request after cleaning up the request headers. It theb records the stat
web/proxy.go:29
↓ 2 callers
Function
catchPanic
CatchPanic is used to catch any Panic.
timezone/timezone.go:105
↓ 2 callers
Function
join
join takes an IP and port values and creates a cleaner string.
udp/udp.go:75
↓ 2 callers
Function
join
join takes an IP and port values and creates a cleaner string.
tcp/tcp.go:107
↓ 2 callers
Method
measureHealth
measureHealth calculates the health of the work pool.
pool/pool.go:280
↓ 2 callers
Function
testSliceInput
(t *testing.T, input map[string]interface{}, expected *Slice)
mapstructure/mapstructure_test.go:768
↓ 1 callers
Method
CheckShutdown
CheckShutdown can be used to check if a shutdown request has been issued.
runner/runner.go:78
↓ 1 callers
Method
DropConnections
DropConnections sets a flag to tell the accept routine to immediately drop connections that come in.
tcp/tcp.go:351
↓ 1 callers
Method
Error
Error implements the error interface for InvalidError.
web/reponse.go:50
↓ 1 callers
Method
Event
Event fires events back to the user for important events.
pool/pool.go:67
↓ 1 callers
Method
Group
Group creates a new App Group based on the current App and provided middleware.
web/web.go:93
↓ 1 callers
Method
Job
(traceID string)
runner/runner.go:23
↓ 1 callers
Function
New
New returns a instance of a logger.
log/log.go:45
↓ 1 callers
Method
Send
Send will deliver the response back to the client.
tcp/tcp.go:301
↓ 1 callers
Method
Validate
Validate checks the configuration to required items.
udp/udp_config.go:25
↓ 1 callers
Method
Validate
Validate checks the configuration to required items.
tcp/tcp_config.go:34
↓ 1 callers
Method
Work
(ctx context.Context, id int)
pool/pool.go:31
↓ 1 callers
Method
decodeBasic
This decodes a basic type (bool, int, string, etc.) and sets the value to "data" of that type.
mapstructure/mapstructure.go:418
↓ 1 callers
Method
decodeBool
(name string, data interface{}, val reflect.Value)
mapstructure/mapstructure.go:525
↓ 1 callers
Method
decodeFloat
(name string, data interface{}, val reflect.Value)
mapstructure/mapstructure.go:556
↓ 1 callers
Method
decodeInt
(name string, data interface{}, val reflect.Value)
mapstructure/mapstructure.go:459
↓ 1 callers
Method
decodeMap
(name string, data interface{}, val reflect.Value)
mapstructure/mapstructure.go:589
↓ 1 callers
Function
decodePath
============================================================================== decodePath shows how to use the DecodePath API call.
examples/mapstructure/main.go:21
↓ 1 callers
Function
decodePathArray
============================================================================== decodePath shows how to use the DecodePath API call with an array of su
examples/mapstructure/main.go:125
↓ 1 callers
Function
decodeSlice
============================================================================== decodeSlice shows how to use the DecodeSlicePath API call.
examples/mapstructure/main.go:96
↓ 1 callers
Method
decodeSlice
(name string, data interface{}, val reflect.Value)
mapstructure/mapstructure.go:647
↓ 1 callers
Method
decodeString
(name string, data interface{}, val reflect.Value)
mapstructure/mapstructure.go:431
↓ 1 callers
Method
decodeStruct
(name string, data interface{}, val reflect.Value)
mapstructure/mapstructure.go:692
↓ 1 callers
Method
decodeUint
(name string, data interface{}, val reflect.Value)
mapstructure/mapstructure.go:492
next →
1–100 of 292, ranked by callers