This commit is contained in:
Stephan D
2026-03-10 12:31:09 +01:00
parent d87e709f43
commit e77d1ab793
287 changed files with 2089 additions and 1550 deletions

View File

@@ -0,0 +1,47 @@
version: "2"
linters:
default: none
enable:
- bodyclose
- canonicalheader
- copyloopvar
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- gosec
- govet
- ineffassign
- nilerr
- nilnesserr
- nilnil
- noctx
- rowserrcheck
- sqlclosecheck
- staticcheck
- unconvert
- wastedassign
disable:
- depguard
- exhaustruct
- gochecknoglobals
- gochecknoinits
- gomoddirectives
- wrapcheck
- cyclop
- dupl
- funlen
- gocognit
- gocyclo
- ireturn
- lll
- mnd
- nestif
- nlreturn
- noinlineerr
- paralleltest
- tagliatelle
- testpackage
- varnamelen
- wsl_v5

View File

@@ -85,52 +85,86 @@ func (c *paymentMethodsClient) Close() error {
return nil
}
func (c *paymentMethodsClient) callContext(ctx context.Context) (context.Context, context.CancelFunc) {
func (c *paymentMethodsClient) CreatePaymentMethod(ctx context.Context, req *methodsv1.CreatePaymentMethodRequest) (*methodsv1.CreatePaymentMethodResponse, error) {
timeout := c.cfg.CallTimeout
if timeout <= 0 {
timeout = 3 * time.Second
}
return context.WithTimeout(ctx, timeout)
}
func (c *paymentMethodsClient) CreatePaymentMethod(ctx context.Context, req *methodsv1.CreatePaymentMethodRequest) (*methodsv1.CreatePaymentMethodResponse, error) {
callCtx, cancel := c.callContext(ctx)
callCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
return c.client.CreatePaymentMethod(callCtx, req)
}
func (c *paymentMethodsClient) GetPaymentMethod(ctx context.Context, req *methodsv1.GetPaymentMethodRequest) (*methodsv1.GetPaymentMethodResponse, error) {
callCtx, cancel := c.callContext(ctx)
timeout := c.cfg.CallTimeout
if timeout <= 0 {
timeout = 3 * time.Second
}
callCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
return c.client.GetPaymentMethod(callCtx, req)
}
func (c *paymentMethodsClient) GetPaymentMethodPrivate(ctx context.Context, req *methodsv1.GetPaymentMethodPrivateRequest) (*methodsv1.GetPaymentMethodPrivateResponse, error) {
callCtx, cancel := c.callContext(ctx)
timeout := c.cfg.CallTimeout
if timeout <= 0 {
timeout = 3 * time.Second
}
callCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
return c.client.GetPaymentMethodPrivate(callCtx, req)
}
func (c *paymentMethodsClient) UpdatePaymentMethod(ctx context.Context, req *methodsv1.UpdatePaymentMethodRequest) (*methodsv1.UpdatePaymentMethodResponse, error) {
callCtx, cancel := c.callContext(ctx)
timeout := c.cfg.CallTimeout
if timeout <= 0 {
timeout = 3 * time.Second
}
callCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
return c.client.UpdatePaymentMethod(callCtx, req)
}
func (c *paymentMethodsClient) DeletePaymentMethod(ctx context.Context, req *methodsv1.DeletePaymentMethodRequest) (*methodsv1.DeletePaymentMethodResponse, error) {
callCtx, cancel := c.callContext(ctx)
timeout := c.cfg.CallTimeout
if timeout <= 0 {
timeout = 3 * time.Second
}
callCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
return c.client.DeletePaymentMethod(callCtx, req)
}
func (c *paymentMethodsClient) SetPaymentMethodArchived(ctx context.Context, req *methodsv1.SetPaymentMethodArchivedRequest) (*methodsv1.SetPaymentMethodArchivedResponse, error) {
callCtx, cancel := c.callContext(ctx)
timeout := c.cfg.CallTimeout
if timeout <= 0 {
timeout = 3 * time.Second
}
callCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
return c.client.SetPaymentMethodArchived(callCtx, req)
}
func (c *paymentMethodsClient) ListPaymentMethods(ctx context.Context, req *methodsv1.ListPaymentMethodsRequest) (*methodsv1.ListPaymentMethodsResponse, error) {
callCtx, cancel := c.callContext(ctx)
timeout := c.cfg.CallTimeout
if timeout <= 0 {
timeout = 3 * time.Second
}
callCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
return c.client.ListPaymentMethods(callCtx, req)
}