MCPcopy Create free account

hub / github.com/ardanlabs/service / functions

Functions918 in github.com/ardanlabs/service

↓ 98 callersFunctionErrorf
Errorf constructs an error based on a error message.
app/sdk/errs/errs.go:67
↓ 68 callersMethodInfo
Info logs at LevelInfo with the given context.
foundation/logger/logger.go:66
↓ 68 callersMethodString
String returns the string representation of the error code.
app/sdk/errs/errs.go:16
↓ 52 callersMethodAdd
Add adds a field error to the collection.
app/sdk/errs/errs.go:124
↓ 52 callersMethodRun
Run performs the actual test logic based on the table data.
app/sdk/apitest/apitest.go:44
↓ 46 callersMethodString
String returns a string representation of the action parameters.
business/domain/userbus/event.go:25
↓ 45 callersFunctionNew
New constructs an error based on an app error.
app/sdk/errs/errs.go:55
↓ 44 callersMethodError
Error implements the error interface.
app/sdk/errs/errs.go:79
↓ 36 callersFunctionStringPointer
StringPointer is a helper to get a *string from a string. It is in the tests package because we normally don't want to deal with pointers to basic typ
business/sdk/dbtest/pointer.go:13
↓ 32 callersFunctionAddSpan
AddSpan adds an otel span to the existing trace.
foundation/otel/otel.go:110
↓ 29 callersMethodValue
Value returns the float value of the money.
business/types/money/money.go:14
↓ 28 callersMethodQuery
(ctx context.Context, filter QueryFilter, orderBy order.By, page page.Page)
business/domain/auditbus/auditbus.go:20
↓ 27 callersMethodCreate
(ctx context.Context, audit Audit)
business/domain/auditbus/auditbus.go:19
↓ 25 callersMethodHandlerFunc
HandlerFunc sets a handler function for a given HTTP method and path pair to the application server mux.
foundation/web/web.go:145
↓ 25 callersMethodString
()
app/domain/grpcauthapp/authapp.pb.go:205
↓ 24 callersFunctionTestSeedUsers
TestSeedUsers is a helper method for testing.
business/domain/userbus/testutil.go:38
↓ 23 callersMethodClose
()
app/sdk/authclient/authclient.go:15
↓ 20 callersMethodAdd
(app *web.App, cfg Config)
app/sdk/mux/mux.go:88
↓ 19 callersMethodDelete
(ctx context.Context, usr User)
business/domain/userbus/userbus.go:33
↓ 19 callersFunctionToken
============================================================================= Token generates an authenticated token for a user.
app/sdk/apitest/apitest.go:102
↓ 18 callersMethodMarshal
Marshal returns the event parameters encoded as JSON.
business/domain/userbus/event.go:30
↓ 17 callersMethodCount
(ctx context.Context, filter QueryFilter)
business/domain/auditbus/auditbus.go:21
↓ 17 callersFunctionParse
Parse parses the string value and returns a name if the value complies with the rules for a name.
business/types/name/name.go:36
↓ 17 callersMethodQueryByID
(ctx context.Context, userID uuid.UUID)
business/domain/userbus/userbus.go:36
↓ 16 callersMethodAuthorize
(ctx context.Context, auth Authorize)
app/sdk/authclient/authclient.go:14
↓ 15 callersMethodToError
ToError converts the field errors to an Error.
app/sdk/errs/errs.go:132
↓ 15 callersMethodUpdate
(ctx context.Context, usr User)
business/domain/userbus/userbus.go:32
↓ 14 callersFunctionNamedExecContext
NamedExecContext is a helper function to execute a CUD operation with logging and tracing where field replacement is necessary.
business/sdk/sqldb/sqldb.go:121
↓ 14 callersFunctionRun
Run performs the actual test logic based on the table data.
business/sdk/unittest/unittest.go:25
↓ 13 callersMethodRowsPerPage
RowsPerPage returns the rows per page.
business/sdk/page/page.go:76
↓ 12 callersMethodNewWithTx
(tx sqldb.CommitRollbacker)
business/domain/userbus/userbus.go:30
↓ 11 callersMethodEncode
()
foundation/web/web.go:22
↓ 11 callersMethodGenerateToken
GenerateToken generates a signed JWT token string representing the user Claims.
app/sdk/auth/auth.go:80
↓ 11 callersFunctionMustParse
MustParse parses the string value and returns a name if the value complies with the rules for a name. If an error occurs the function panics.
business/types/name/name.go:46
↓ 11 callersFunctionNamedQueryStruct
NamedQueryStruct is a helper function for executing queries that return a single value to be unmarshalled into a struct type where field replacement i
business/sdk/sqldb/sqldb.go:239
↓ 11 callersFunctionNewFieldErrors
NewFieldErrors creates a field errors.
app/sdk/errs/errs.go:112
↓ 11 callersFunctionnew
(w io.Writer, minLevel Level, serviceName string, traceIDFn TraceIDFn, events Events)
foundation/logger/logger.go:139
↓ 10 callersMethodAuthenticate
(ctx context.Context, authorization string)
app/sdk/authclient/authclient.go:13
↓ 10 callersMethodIssuer
Issuer provides the configured issuer used to authenticate tokens.
app/sdk/auth/auth.go:75
↓ 9 callersFunctionDecode
Decode reads the body of an HTTP request and decodes the body into the specified data model. If the data model implements the validator interface, the
foundation/web/request.go:26
↓ 9 callersFunctionNamedQuerySlice
NamedQuerySlice is a helper function for executing queries that return a collection of data to be unmarshalled into a slice where field replacement is
business/sdk/sqldb/sqldb.go:163
↓ 9 callersFunctionOpen
Open knows how to open a database connection based on the configuration.
business/sdk/sqldb/sqldb.go:48
↓ 8 callersFunctionAuthorize
Authorize validates authorization via the auth service.
app/sdk/mid/authorize.go:23
↓ 8 callersFunctionNewBy
NewBy constructs a new By value with no checks.
business/sdk/order/order.go:27
↓ 8 callersFunctionTestGenerateSeedProducts
TestGenerateSeedProducts is a helper method for testing.
business/domain/productbus/testutil.go:36
↓ 8 callersMethodwrite
(ctx context.Context, level Level, caller int, msg string, args ...any)
foundation/logger/logger.go:119
↓ 7 callersMethodError
Error logs at LevelError with the given context.
foundation/logger/logger.go:102
↓ 7 callersFunctionGetClaims
GetClaims returns the claims from the context.
app/sdk/mid/mid.go:44
↓ 7 callersFunctionNewBusiness
NewBusiness constructs a user business API for use.
business/domain/userbus/userbus.go:67
↓ 7 callersMethodNumber
Number returns the page number.
business/sdk/page/page.go:71
↓ 7 callersFunctionParse
Parse parses the strings and validates the values are in reason.
business/sdk/page/page.go:16
↓ 7 callersFunctionscanLinearArray
(src, del []byte, typ string)
business/sdk/sqldb/dbarray/dbarray.go:911
↓ 6 callersFunctionAuthenticate
Authenticate is a middleware function that integrates with an authentication client to validate user credentials and attach user data to the request c
app/sdk/mid/authen.go:23
↓ 6 callersFunctionNew
New creates a new test database inside the database that was started to handle testing. The database is migrated to the current version and a connecti
business/sdk/dbtest/dbtest.go:29
↓ 6 callersFunctionNew
New initialized the system to run a test.
app/sdk/apitest/start.go:16
↓ 6 callersFunctionNewStore
NewStore constructs the api for data access.
business/domain/userbus/stores/userdb/userdb.go:27
↓ 6 callersFunctionParse
============================================================================= Parse parses the float value and returns a quantity if the value complie
business/types/quantity/quantity.go:37
↓ 6 callersFunctionParse
============================================================================= Parse parses the float value and returns a money if the value complies w
business/types/money/money.go:37
↓ 6 callersFunctionParseToString
ParseToString takes a collection of user roles and converts them to a slice of string.
business/types/role/role.go:68
↓ 5 callersFunctionGetSubjectID
GetSubjectID returns the subject id from the claims.
app/sdk/mid/mid.go:53
↓ 5 callersFunctionMustParse
MustParse parses the string value and returns a quantity if the value complies with the rules for a quantity. If an error occurs the function panics.
business/types/quantity/quantity.go:47
↓ 5 callersFunctionMustParse
MustParse parses the string value and returns a money if the value complies with the rules for a money. If an error occurs the function panics.
business/types/money/money.go:47
↓ 5 callersFunctionMustParse
MustParse creates a paging value for testing.
business/sdk/page/page.go:56
↓ 5 callersFunctionMustParseNull
MustParseNull parses the string value and returns a name if the value complies with the rules for a name. If an error occurs the function panics.
business/types/name/name.go:108
↓ 5 callersFunctionNamePointer
NamePointer is a helper to get a *Name from a string. It's in the tests package because we normally don't want to deal with pointers to basic types bu
business/sdk/dbtest/pointer.go:41
↓ 5 callersFunctionNewResult
NewResult constructs a result value to return query results.
app/sdk/query/query.go:19
↓ 5 callersFunctionParam
Param returns the web call parameters from the request.
foundation/web/request.go:10
↓ 5 callersFunctionParse
============================================================================= Parse parses the string value and returns a home type if one exists.
business/types/home/home.go:46
↓ 5 callersFunctionParse
Parse constructs a By value by parsing a string in the form of "field,direction" ie "user_id,ASC".
business/sdk/order/order.go:43
↓ 5 callersFunctionParseNull
============================================================================= ParseNull parses the string value and returns a name if the value compli
business/types/name/name.go:94
↓ 5 callersMethodQueryByEmail
(ctx context.Context, email mail.Address)
business/domain/userbus/userbus.go:37
↓ 5 callersMethodShutdown
Shutdown stops the gRPC service.
app/domain/grpcauthapp/authapp.go:45
↓ 5 callersMethodStart
Start lookups a job by key and launches a goroutine to perform the work. A work key is returned so the caller can cancel work early.
foundation/worker/worker.go:91
↓ 5 callersMethodString
String implements the stringer interface.
business/sdk/page/page.go:66
↓ 5 callersFunctiontoAppUser
(bus userbus.User)
app/domain/userapp/model.go:34
↓ 4 callersFunctionApplyFilter
ApplyFilter appends a WHERE clause to buf based on the fields set in filter and adds the matching named bind values to data. The clause uses only port
business/domain/productbus/stores/commondb/filter.go:14
↓ 4 callersMethodAuthorize
Authorize a request based on user claims and a rule.
app/domain/grpcauthapp/authapp_grpc.pb.go:38
↓ 4 callersMethodDecode
(data []byte)
foundation/web/request.go:16
↓ 4 callersFunctionGetExtContext
GetExtContext is a helper function that extracts the sqlx value from the domain transactor interface for transactional use.
business/sdk/sqldb/tran.go:42
↓ 4 callersFunctionGetUser
GetUser returns the user from the context.
app/sdk/mid/mid.go:83
↓ 4 callersFunctionGetUserID
GetUserID returns the user id from the context.
app/sdk/mid/mid.go:69
↓ 4 callersFunctionGetWriter
GetWriter returns the underlying writer for the request.
foundation/web/context.go:39
↓ 4 callersMethodInfoc
Infoc logs the information at the specified call stack position.
foundation/logger/logger.go:75
↓ 4 callersFunctionMustParse
MustParse parses the string value and returns a password if the value complies with the rules for a password. If an error occurs the function panics.
business/types/password/password.go:45
↓ 4 callersMethodName
Name reports a short identifier for the engine (for logging only).
business/sdk/sqldb/dialect/dialect.go:17
↓ 4 callersFunctionNew
New creates an Auth to support authentication/authorization.
app/sdk/auth/auth.go:63
↓ 4 callersFunctionNewStdLogger
NewStdLogger returns a standard library Logger that wraps the slog Logger.
foundation/logger/logger.go:43
↓ 4 callersFunctionParseMany
ParseMany takes a collection of strings and converts them to a slice of roles.
business/types/role/role.go:79
↓ 4 callersMethodQueryByUserID
(ctx context.Context, userID uuid.UUID)
business/domain/homebus/homebus.go:35
↓ 4 callersMethodRegister
Register adds a function to be called for a specified domain and action.
business/sdk/delegate/delegate.go:35
↓ 4 callersMethodRunning
Running returns the number of jobs running.
foundation/worker/worker.go:48
↓ 4 callersMethodScan
Scan implements the sql.Scanner interface.
business/sdk/sqldb/dbarray/dbarray.go:104
↓ 4 callersMethodShutdown
Shutdown waits for all jobs to complete before it returns.
foundation/worker/worker.go:56
↓ 4 callersFunctionStatusCheck
StatusCheck returns nil if it can successfully talk to the database. It returns a non-nil error otherwise.
business/sdk/sqldb/sqldb.go:81
↓ 4 callersFunctionTestGenerateSeedHomes
TestGenerateSeedHomes is a helper method for testing.
business/domain/homebus/testutil.go:45
↓ 4 callersFunctionToBusProducts
ToBusProducts converts a slice of database rows into business products.
business/domain/productbus/stores/commondb/model.go:80
↓ 4 callersFunctionToDBProduct
ToDBProduct converts a business product into its database representation.
business/domain/productbus/stores/commondb/model.go:34
↓ 4 callersFunctionWebAPI
WebAPI constructs a http.Handler with all application routes bound.
app/sdk/mux/mux.go:92
↓ 4 callersFunctionappendArrayQuotedBytes
(b, v []byte)
business/sdk/sqldb/dbarray/dbarray.go:779
↓ 4 callersFunctioncheckIsError
(e web.Encoder)
app/sdk/mid/mid.go:17
next →1–100 of 918, ranked by callers