profile
viewpoint

pace/bricks 112

A standard library for microservices.

daemonfire300/Eryan 1

Eryan EVE Bot platform

daemonfire300/mail 1

Actively maintained fork of gomail. The best way to send emails in Go.

daemonfire300/warfrareinc 1

WarfrareINC is a cake-based browsergame prototype

pace/keycloak-operator 1

A Kubernetes Operator based on the Operator SDK for syncing resources in Keycloak

daemonfire300/azure-sdk-for-go 0

Microsoft Azure SDK for Go

release pace/bricks

v0.1.64

released time in 2 days

created tagpace/bricks

tagv0.1.64

A standard library for microservices.

created time in 2 days

issue openedpace/bricks

Sporadic failure in test (travis-ci) for locale package

=== RUN   TestLocale_Now/no_locale

    TestLocale_Now/no_locale: locale_test.go:84: 

        	Error Trace:	locale_test.go:84

        	Error:      	Not equal: 

        	            	expected: "2020-06-30 06:25:40 +0000 UTC"

        	            	actual  : "2020-06-30 06:25:41 +0000 UTC"

        	            	

        	            	Diff:

        	            	--- Expected

        	            	+++ Actual

        	            	@@ -1 +1 @@

        	            	-2020-06-30 06:25:40 +0000 UTC

        	            	+2020-06-30 06:25:41 +0000 UTC

        	Test:       	TestLocale_Now/no_locale

--- FAIL: TestLocale_Now (0.01s)

    --- FAIL: TestLocale_Now/invalid_locale (0.00s)

    --- FAIL: TestLocale_Now/valid_locale (0.00s)

    --- FAIL: TestLocale_Now/no_locale (0.00s)

https://travis-ci.org/github/pace/bricks/builds/703420638

created time in 2 days

PR opened pace/bricks

Return on error when RoundTrip()'ing
+3 -1

0 comment

1 changed file

pr created time in 3 days

create barnchpace/bricks

branch : fix-roundtripper-ignored-error-dump

created branch time in 3 days

Pull request review commentpace/bricks

Prevent panic on queue package loading

 var ( 	queueHealthLimits sync.Map ) -func init() {+func initDefault() {+	if rmqConnection != nil {

Ok, so I am accepting this, but I do not have the best of feelings because I suspect we might run into problems reusing the same redis connection for every queue if this should ever be used with multiple queues and multiple routines (multiple redis servers).

Ferlonas

comment created time in 7 days

Pull request review commentpace/bricks

Prevent panic on queue package loading

 var ( 	queueHealthLimits sync.Map ) -func init() {+func initDefault() {+	if rmqConnection != nil {

Is there a functionality to "close" the queue and does that also close the connection to redis?

Ferlonas

comment created time in 7 days

Pull request review commentpace/bricks

Prevent panic on queue package loading

 var ( 	queueHealthLimits sync.Map ) -func init() {+func initDefault() {+	if rmqConnection != nil {

Let me rephrase that: Am I seeing a singleton pattern here, and if yes is this intentional, and if yes why?

Ferlonas

comment created time in 7 days

Pull request review commentpace/bricks

Prevent panic on queue package loading

 var ( 	queueHealthLimits sync.Map ) -func init() {+func initDefault() {+	if rmqConnection != nil {

Singleton pattern?

Ferlonas

comment created time in 7 days

create barnchdaemonfire300/algodat-playground

branch : master

created branch time in 10 days

issue openedadjust/rmq

Support for Redis Streams

https://redis.io/topics/streams-intro

Just a question, is support for redis streams planned?

created time in 10 days

Pull request review commentpace/bricks

implements a simple long polling func

+package longpoll++import (+	"context"+	"time"+)++// LongPollFunc should return true if long polling did+// resolve, false otherwise. If error is returned, the+// long polling will be canceled+type LongPollFunc func() (bool, error)

Do we want to add a context.Context to the LongPollFunc so that it can explicitly react to context "events" (cancelation etc.) of the "parent" context, i.e, the one given by Until(ctx context.Context, ...).

The caller then could still choose to ignore the context in the function, but would have the ability to use it without explicitly passing it into the function body when the function is being defined.

Just a thought of a possibly "problematic" scenario would be, the a LongPollFunc gets created "somewhere" and spawns a goroutine that gets terminated by a context with deadline or something similar. If we now pass by accident or whatever reasons two different contexts into Until we might end up with strange behaviour such as, the long polling randomly failing after 10 seconds, although the MinWaitTime is like 60 seconds. We would see the context cancellation error, yes, but we would need to track down which context actually caused the cancellation. And when the definition of a LongPollFunc and the call to Until are in different scopes this might be hard to keep track off.

threez

comment created time in 23 days

Pull request review commentpace/bricks

implements a simple long polling func

+package longpoll++import (+	"context"+	"time"+)++// LongPollFunc should return true if long polling did+// resolve, false otherwise. If error is returned, the+// long polling will be canceled+type LongPollFunc func() (bool, error)

Do we really need the boolean here? Does something speak against a dedicated error like ErrDidNotResolve

threez

comment created time in 23 days

created tagpace/bricks

tagv0.1.51

A standard library for microservices.

created time in a month

release pace/bricks

v0.1.51

released time in a month

delete branch pace/bricks

delete branch : fix-missing-decimal-format

delete time in a month

push eventpace/bricks

Nico Mürdter

commit sha 4782d70c500fdfcf7815e94718a0b72d83968ee5

Add format decimal to openapi number type (#202)

view details

push time in a month

PR merged pace/bricks

Add format decimal to openapi number type
+24 -21

0 comment

4 changed files

Smuerdt

pr closed time in a month

pull request commentswagger-api/swagger-codegen

Add option for resolveFully

@jweisman I could test this against my locally present collection of yaml's to check whether this is working, but need to figure out the command parameters again, since it has been quite some time since I had a look at this.

jweisman

comment created time in 2 months

delete branch pace/bricks

delete branch : fix-index-out-of-range

delete time in 2 months

created tagpace/bricks

tagv0.1.46

A standard library for microservices.

created time in 2 months

release pace/bricks

v0.1.46

released time in 2 months

push eventpace/bricks

Marius Neugebauer

commit sha ce04c4c725cfd0d81d7d3f50a3970a89cb4762b1

fix index out of range panic (#193)

view details

push time in 2 months

PR merged pace/bricks

Reviewers
fix index out of range panic
+1 -1

1 comment

1 changed file

Teelevision

pr closed time in 2 months

pull request commentpace/bricks

fix index out of range panic

An easy fix is an easy win. I would say this PR is a win win

Teelevision

comment created time in 2 months

created tagpace/bricks

tagv0.1.43

A standard library for microservices.

created time in 2 months

release pace/bricks

v0.1.43

released time in 2 months

push eventpace/bricks

Julius F

commit sha 414971f152b2d844ddf9c2e51a495e6749fd7664

Add locale.ContextTransfer to routine.Run(...) for context transfer (#189)

view details

push time in 2 months

delete branch pace/bricks

delete branch : add-locale-context-transfer-to-routine

delete time in 2 months

push eventpace/bricks

Julius Foitzik

commit sha 89689a0743b819bbc2a4c420b628ccdbdfe8fa97

Add locale.ContextTransfer to routine.Run(...) for context transfer

view details

push time in 2 months

push eventpace/bricks

Julius Foitzik

commit sha c03a93b26aa62a1c05abe563a2a87491edcbec50

Add locale.ContextTransfer to routine.Run(...) for context transfer

view details

push time in 2 months

create barnchpace/bricks

branch : add-locale-context-transfer-to-routine

created branch time in 2 months

create barnchdaemonfire300/mail

branch : allow-plain-auth-via-insecure-means

created branch time in 3 months

fork daemonfire300/mail

Actively maintained fork of gomail. The best way to send emails in Go.

fork in 3 months

created tagpace/bricks

tagv0.1.42

A standard library for microservices.

created time in 3 months

release pace/bricks

v0.1.42

released time in 3 months

push eventpace/bricks

threez

commit sha 06f058dd9176a2a565d3da7769a22df25db4fad9

implements locale package (#187) * implements locale package * accept language and timezone extraction from request * propagation via transports and middleware Co-authored-by: Julius Foitzik <info@accountr.eu>

view details

push time in 3 months

delete branch pace/bricks

delete branch : accept-lang-and-timezone

delete time in 3 months

PR merged pace/bricks

Reviewers
implements locale package S::Ready T::Feature
  • accept language and timezone extraction from request
  • propagation via transports and middleware
+602 -1

0 comment

13 changed files

threez

pr closed time in 3 months

push eventpace/bricks

Julius Foitzik

commit sha 55789c39adad8610c6e1cf770fd5a6d19306823e

Fix typo

view details

push time in 3 months

pull request commentpace/bricks

Add 1.13 error handling to oauth2 intrespection #184

We probably also need a regression test for this.

daemonfire300

comment created time in 3 months

PR opened pace/bricks

Add 1.13 error handling to oauth2 intrespection #184

This avoids 500 responses when a user token is invalid

https://github.com/pace/bricks/issues/184

+5 -7

0 comment

1 changed file

pr created time in 3 months

push eventpace/bricks

Julius Foitzik

commit sha 5b3d340a11f6185c9885b9368006aa14e003ee03

Add 1.13 error handling to oauth2 intrespection This avoids 500 responses when a user token is invalid

view details

push time in 3 months

create barnchpace/bricks

branch : 184-oauth2-1-13-error-handling

created branch time in 3 months

issue openedpace/bricks

OAuth2 Introspection use 1.13 error handling and not return 500 on invalid tokens

Problem

ErrInvalidToken is being wrapped. The code above the callee does not use errors.Is but explicit checks this results in http 500.

Soluation

Use 1.13 error handling

created time in 3 months

Pull request review commentpace/bricks

testable filter/sorting/pagination

 func (m *MapMapper) Map(value string) (string, bool) { 	return val, isValid } -// PaginationFromRequest extracts pagination query parameter and  returns a function that adds the pagination to a query-func PaginationFromRequest(r *http.Request) (QueryOption, error) {+// UrlQueryParameters contains all information that are needed for pagination, sorting and filtering.+// It is not depending on orm.Query+type UrlQueryParameters struct {+	HasPagination bool+	PageNr        int+	PageSize      int+	Order         []string+	Filter        map[string][]interface{}+}++// ReadURLQueryParameters reads sorting, filter and pagination from requests and return a UrlQueryParameters object,+// even if any errors occur. The returned error combines all errors of pagination, filter and sorting.+func ReadURLQueryParameters(r *http.Request, mapper ColumnMapper, sanitizer ValueSanitizer) (*UrlQueryParameters, error) {+	result := &UrlQueryParameters{}+	errPagination := result.setPagination(r)+	errSorting := result.setSorting(r, mapper)+	errFilter := result.setFilter(r, mapper, sanitizer)+	if errPagination != nil || errSorting != nil || errFilter != nil {+		err := fmt.Errorf("problems occured while ready filter, sorting or pagination from request: filter: %w, sorting: %w, pagination: %w", errFilter, errSorting, errPagination)+		return result, err+	}+	return result, nil+}++// AddToQuery adds filter, sorting and pagination to a orm.Query+func (u *UrlQueryParameters) AddToQuery(query *orm.Query) *orm.Query {+	if u.HasPagination {+		if u.PageNr == 0 {+			query.Offset(0)+		} else {+			query.Offset((u.PageSize * u.PageNr) - 1)+		}+		query.Limit(u.PageSize)+	}+	for name, filterValues := range u.Filter {+		if len(filterValues) == 0 {+			continue+		}++		if len(filterValues) == 1 {+			query.Where(name+" = ?", filterValues[0])+			continue+		}+		query.Where(name+" IN (?)", pg.In(filterValues))+	}+	for _, val := range u.Order {+		query.Order(val)+	}+	return query++}++func (u *UrlQueryParameters) setPagination(r *http.Request) error { 	pageStr := r.URL.Query().Get("page[number]") 	sizeStr := r.URL.Query().Get("page[size]") 	if pageStr == "" || sizeStr == "" {

e.g., we could use cfg.MinPageSize if none is set?

SchlottiP

comment created time in 3 months

Pull request review commentpace/bricks

testable filter/sorting/pagination

 func (m *MapMapper) Map(value string) (string, bool) { 	return val, isValid } -// PaginationFromRequest extracts pagination query parameter and  returns a function that adds the pagination to a query-func PaginationFromRequest(r *http.Request) (QueryOption, error) {+// UrlQueryParameters contains all information that are needed for pagination, sorting and filtering.+// It is not depending on orm.Query+type UrlQueryParameters struct {+	HasPagination bool+	PageNr        int+	PageSize      int+	Order         []string+	Filter        map[string][]interface{}+}++// ReadURLQueryParameters reads sorting, filter and pagination from requests and return a UrlQueryParameters object,+// even if any errors occur. The returned error combines all errors of pagination, filter and sorting.+func ReadURLQueryParameters(r *http.Request, mapper ColumnMapper, sanitizer ValueSanitizer) (*UrlQueryParameters, error) {+	result := &UrlQueryParameters{}+	errPagination := result.setPagination(r)

minor issue, setXXX implies that result does something to the pointer (method argument) it receives. This might be confusing when looking at these methods in the future.

Mabye readXXX or extractXXX?

SchlottiP

comment created time in 3 months

Pull request review commentpace/bricks

testable filter/sorting/pagination

 func (m *MapMapper) Map(value string) (string, bool) { 	return val, isValid } -// PaginationFromRequest extracts pagination query parameter and  returns a function that adds the pagination to a query-func PaginationFromRequest(r *http.Request) (QueryOption, error) {+// UrlQueryParameters contains all information that are needed for pagination, sorting and filtering.+// It is not depending on orm.Query+type UrlQueryParameters struct {+	HasPagination bool+	PageNr        int+	PageSize      int+	Order         []string+	Filter        map[string][]interface{}+}++// ReadURLQueryParameters reads sorting, filter and pagination from requests and return a UrlQueryParameters object,+// even if any errors occur. The returned error combines all errors of pagination, filter and sorting.+func ReadURLQueryParameters(r *http.Request, mapper ColumnMapper, sanitizer ValueSanitizer) (*UrlQueryParameters, error) {+	result := &UrlQueryParameters{}+	errPagination := result.setPagination(r)+	errSorting := result.setSorting(r, mapper)+	errFilter := result.setFilter(r, mapper, sanitizer)+	if errPagination != nil || errSorting != nil || errFilter != nil {+		err := fmt.Errorf("problems occured while ready filter, sorting or pagination from request: filter: %w, sorting: %w, pagination: %w", errFilter, errSorting, errPagination)+		return result, err+	}+	return result, nil+}++// AddToQuery adds filter, sorting and pagination to a orm.Query+func (u *UrlQueryParameters) AddToQuery(query *orm.Query) *orm.Query {+	if u.HasPagination {+		if u.PageNr == 0 {+			query.Offset(0)+		} else {+			query.Offset((u.PageSize * u.PageNr) - 1)+		}+		query.Limit(u.PageSize)+	}+	for name, filterValues := range u.Filter {+		if len(filterValues) == 0 {+			continue+		}++		if len(filterValues) == 1 {+			query.Where(name+" = ?", filterValues[0])+			continue+		}+		query.Where(name+" IN (?)", pg.In(filterValues))+	}+	for _, val := range u.Order {+		query.Order(val)+	}+	return query++}++func (u *UrlQueryParameters) setPagination(r *http.Request) error { 	pageStr := r.URL.Query().Get("page[number]") 	sizeStr := r.URL.Query().Get("page[size]") 	if pageStr == "" || sizeStr == "" {

Can't we have a default page size? Does the jsonapi spec require both parameter to be set?

I would suggest that we allow pagination with "only" the page number.

SchlottiP

comment created time in 3 months

Pull request review commentpace/bricks

testable filter/sorting/pagination

 func (m *MapMapper) Map(value string) (string, bool) { 	return val, isValid } -// PaginationFromRequest extracts pagination query parameter and  returns a function that adds the pagination to a query-func PaginationFromRequest(r *http.Request) (QueryOption, error) {+// UrlQueryParameters contains all information that are needed for pagination, sorting and filtering.

either pluralize information or use "that is needed", or maybe my english is not good enough :D

SchlottiP

comment created time in 3 months

issue openedGoogleContainerTools/kit

Still active?

<!-- The more detail you can give us the better solutions we can come up with together! -->

Use case description

Integration Testing of Microservice Architectures based on kubernetes intra and cross-cluster.

Pain points

Is this project still being maintained / developed?

created time in 3 months

more