Skip to content

Commit

Permalink
Update company name + links (#96)
Browse files Browse the repository at this point in the history
* Update company name + links

* Version #
  • Loading branch information
Jake Nichols authored Jul 7, 2023
1 parent e773fe6 commit fe9a5c8
Show file tree
Hide file tree
Showing 38 changed files with 138 additions and 138 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ We welcome community contributions to Matcha!
## Getting Started

1. Ensure you have [installed Golang](https://go.dev/dl/) on your development machine. Matcha is currently on version `1.20.2`.
2. Create a fork of Matcha to your personal GitHub account. Direct branches or pushes to the `CloudRETIC` repository are not accepted.
2. Create a fork of Matcha to your personal GitHub account. Direct branches or pushes to the `Decent Platforms` repository are not accepted.
3. Clone your personal fork to your development machine, and enter the directory.
4. Add the upstream repository: `git remote add upstream [http-or-ssh-address]`

Expand Down Expand Up @@ -57,11 +57,11 @@ Currently, new submissions to Matcha are subject to the following criteria:
1. **Performance**: Changes must not significantly decrease performance unless they are urgent bugfixes. End-to-end benchmarks are provided in the docs folder; additionally, if your feature or change is to a system that is integrated heavily, we suggest you add and check benchmarks for it.
2. **Testing**: Test coverage should stay above 95%. New behavior is expected to have associated unit tests, and PRs that drop coverage by more than 2%, or below 90%, will be automatically rejected.
3. **Documentation**: CloudRETIC strongly encourages in-code documentation. Maintainers may request that you add additional documentation to your code.
3. **Documentation**: Decent Platforms strongly encourages in-code documentation. Maintainers may request that you add additional documentation to your code.
4. **Style**: Follow good Go code practices. We use [this list](https://github.com/golang/go/wiki/CodeReviewComments#gofmt) to evaluate style.
5. **Zero-Dependency**: Matcha does not use any external libraries. Changes with dependencies will be rejected.
We additionally ask that you avoid the use of AI tools like ChatGPT and GitHub Copilot in your contributions to Matcha. CloudRETIC has concerns regarding the ethics and copyright implications of scraping open-source code for training data, and would prefer that any work submitted be attributable to the users that directly contribute to it.
We additionally ask that you avoid the use of AI tools like ChatGPT and GitHub Copilot in your contributions to Matcha. Decent Platforms has concerns regarding the ethics and copyright implications of scraping open-source code for training data, and would prefer that any work submitted be attributable to the users that directly contribute to it.
## Versioning Policy
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# matcha

[![Coverage Status](https://coveralls.io/repos/github/cloudretic/matcha/badge.svg?branch=main)](https://coveralls.io/github/cloudretic/matcha?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/cloudretic/matcha)](https://goreportcard.com/report/github.com/cloudretic/matcha)
[![Coverage Status](https://coveralls.io/repos/github/decentplatforms/matcha/badge.svg?branch=main)](https://coveralls.io/github/decentplatforms/matcha?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/decentplatforms/matcha)](https://goreportcard.com/report/github.com/decentplatforms/matcha)
[![Discord Badge](https://img.shields.io/badge/Join%20us%20on-Discord-blue)](https://discord.gg/gCdJ6NPm)

`cloudretic/matcha` is an HTTP router designed for ease of use, power, and extensibility.
Matcha is an HTTP router designed for ease of use, power, and extensibility.

## Features

Expand All @@ -17,7 +17,7 @@

## Installation

`go get github.com/cloudretic/[email protected].0`
`go get github.com/decentplatforms/[email protected].1`

## Basic Usage

Expand All @@ -29,7 +29,7 @@ package examples
import (
"net/http"

"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/router"
)

func sayHello(w http.ResponseWriter, req *http.Request) {
Expand Down Expand Up @@ -91,11 +91,11 @@ Concurrent | 1353 ns/request | 1453 bytes/request | 14 allocs/request

Name | Role | Pronouns | GitHub Username | Contact
---|---|---|---|---
Jake Nichols | Creator | they/them | jakenichols2719 | <jnichols@cloudretic.com>
Jake Nichols | Creator | they/them | jakenichols2719 | <jnichols@decentplatforms.com>

## License

Copyright 2023 CloudRETIC LLC
Copyright 2023 Decent Platforms LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions bench/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"net/http"
"strconv"

"github.com/cloudretic/matcha/pkg/cors"
"github.com/cloudretic/matcha/pkg/middleware"
"github.com/cloudretic/matcha/pkg/rctx"
"github.com/cloudretic/matcha/pkg/route/require"
"github.com/decentplatforms/matcha/pkg/cors"
"github.com/decentplatforms/matcha/pkg/middleware"
"github.com/decentplatforms/matcha/pkg/rctx"
"github.com/decentplatforms/matcha/pkg/route/require"
)

type benchRoute struct {
Expand All @@ -21,7 +21,7 @@ type benchRoute struct {

func mwCORS() middleware.Middleware {
return cors.CORSMiddleware(&cors.AccessControlOptions{
AllowOrigin: []string{"cloudretic.com"},
AllowOrigin: []string{"decentplatforms.com"},
AllowMethods: []string{http.MethodGet, http.MethodPut, http.MethodDelete},
AllowHeaders: []string{"client_id"},
})
Expand Down
26 changes: 13 additions & 13 deletions bench/v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sync"
"testing"

"github.com/cloudretic/matcha/pkg/route"
"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/route"
"github.com/decentplatforms/matcha/pkg/router"
)

/*
Expand All @@ -34,20 +34,20 @@ import (
// MockBoards API
var apiRoutes = []benchRoute{
// Get/create posts
{method: http.MethodGet, path: "/[board]/posts", testPath: "/cloudretic/posts", mws: api_mws, rqs: api_rqs},
{method: http.MethodPut, path: "/[board]/posts", testPath: "/cloudretic/posts", mws: api_mws, rqs: api_rqs},
{method: http.MethodGet, path: "/[board]/posts/[order]{new|top}", testPath: "/cloudretic/posts/new", mws: api_mws, rqs: api_rqs},
{method: http.MethodGet, path: "/[board]/posts", testPath: "/decentplatforms/posts", mws: api_mws, rqs: api_rqs},
{method: http.MethodPut, path: "/[board]/posts", testPath: "/decentplatforms/posts", mws: api_mws, rqs: api_rqs},
{method: http.MethodGet, path: "/[board]/posts/[order]{new|top}", testPath: "/decentplatforms/posts/new", mws: api_mws, rqs: api_rqs},
// Get/update/delete post
{method: http.MethodPatch, path: "/[board]/posts/[id]", testPath: "/cloudretic/posts/2719", mws: api_mws, rqs: api_rqs},
{method: http.MethodDelete, path: "/[board]/posts/[id]", testPath: "/cloudretic/posts/2719", mws: api_mws, rqs: api_rqs},
{method: http.MethodPatch, path: "/[board]/posts/[id]", testPath: "/decentplatforms/posts/2719", mws: api_mws, rqs: api_rqs},
{method: http.MethodDelete, path: "/[board]/posts/[id]", testPath: "/decentplatforms/posts/2719", mws: api_mws, rqs: api_rqs},
// Get/create comments
{method: http.MethodGet, path: "/[board]/posts/[id]/comments", testPath: "/cloudretic/posts/2719/comments", mws: api_mws, rqs: api_rqs},
{method: http.MethodPut, path: "/[board]/posts/[id]/comments", testPath: "/cloudretic/posts/2719/comments", mws: api_mws, rqs: api_rqs},
{method: http.MethodGet, path: "/[board]/posts/[id]/comments/[order]{new|top}", testPath: "/cloudretic/posts/2719/comments/new", mws: api_mws, rqs: api_rqs},
{method: http.MethodGet, path: "/[board]/posts/[id]/comments", testPath: "/decentplatforms/posts/2719/comments", mws: api_mws, rqs: api_rqs},
{method: http.MethodPut, path: "/[board]/posts/[id]/comments", testPath: "/decentplatforms/posts/2719/comments", mws: api_mws, rqs: api_rqs},
{method: http.MethodGet, path: "/[board]/posts/[id]/comments/[order]{new|top}", testPath: "/decentplatforms/posts/2719/comments/new", mws: api_mws, rqs: api_rqs},
// Get/update/delete comment
{method: http.MethodGet, path: "/[board]/posts/[id]/comments/[id]", testPath: "/cloudretic/posts/2719/comments/2719", mws: api_mws, rqs: api_rqs},
{method: http.MethodPatch, path: "/[board]/posts/[id]/comments/[id]", testPath: "/cloudretic/posts/2719/comments/2719", mws: api_mws, rqs: api_rqs},
{method: http.MethodDelete, path: "/[board]/posts/[id]/comments/[id]", testPath: "/cloudretic/posts/2719/comments/2719", mws: api_mws, rqs: api_rqs},
{method: http.MethodGet, path: "/[board]/posts/[id]/comments/[id]", testPath: "/decentplatforms/posts/2719/comments/2719", mws: api_mws, rqs: api_rqs},
{method: http.MethodPatch, path: "/[board]/posts/[id]/comments/[id]", testPath: "/decentplatforms/posts/2719/comments/2719", mws: api_mws, rqs: api_rqs},
{method: http.MethodDelete, path: "/[board]/posts/[id]/comments/[id]", testPath: "/decentplatforms/posts/2719/comments/2719", mws: api_mws, rqs: api_rqs},
// Get user info
// Posts/comments
{method: http.MethodGet, path: "/[user]/posts", testPath: "/jnichols/posts", mws: api_mws, rqs: api_rqs},
Expand Down
4 changes: 2 additions & 2 deletions bench/v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sync"
"testing"

"github.com/cloudretic/matcha/pkg/route"
"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/route"
"github.com/decentplatforms/matcha/pkg/router"
)

/*
Expand Down
22 changes: 11 additions & 11 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Hello! This is a step-by-step guide to using Matcha for HTTP handling in Go.

### Hello World

To start us off, here's a basic example. You can find project examples in the GitHub [here](https://github.com/cloudretic/matcha/tree/main/examples) if you want to experiment with them.
To start us off, here's a basic example. You can find project examples in the GitHub [here](https://github.com/decentplatforms/matcha/tree/main/examples) if you want to experiment with them.

```go
package examples

import (
"net/http"

"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/router"
)

func sayHello(w http.ResponseWriter, req *http.Request) {
Expand Down Expand Up @@ -53,8 +53,8 @@ package examples
import (
"net/http"

"github.com/cloudretic/matcha/pkg/rctx"
"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/rctx"
"github.com/decentplatforms/matcha/pkg/router"
)

func echoAdmin(w http.ResponseWriter, req *http.Request) {
Expand Down Expand Up @@ -91,8 +91,8 @@ import (
"net/http"
"os"

"github.com/cloudretic/matcha/pkg/rctx"
"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/rctx"
"github.com/decentplatforms/matcha/pkg/router"
)

type fileServer struct {
Expand Down Expand Up @@ -169,9 +169,9 @@ Matcha uses `func(w http.ResponseWriter, req *http.Request) *http.Request` for m
package main

import (
"github.com/cloudretic/matcha/pkg/router"
"github.com/cloudretic/matcha/pkg/route"
"github.com/cloudretic/matcha/pkg/middleware"
"github.com/decentplatforms/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/route"
"github.com/decentplatforms/matcha/pkg/middleware"
)

func main() {
Expand All @@ -193,10 +193,10 @@ Matcha provides an interface for matching things that are not paths in package `
```go
webRoute, err := route.New(
http.MethodGet, "/",
route.Require(require.HostPorts("https://{www.|}cloudretic.com")),
route.Require(require.HostPorts("https://{www.|}decentplatforms.com")),
)
apiRoute, err := route.New(
http.MethodGet, "/",
require.HostPorts("https://api.cloudretic.com"),
require.HostPorts("https://api.decentplatforms.com"),
)
```
4 changes: 2 additions & 2 deletions examples/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package examples
import (
"net/http"

"github.com/cloudretic/matcha/pkg/rctx"
"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/rctx"
"github.com/decentplatforms/matcha/pkg/router"
)

func echoAdmin(w http.ResponseWriter, req *http.Request) {
Expand Down
4 changes: 2 additions & 2 deletions examples/fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"os"

"github.com/cloudretic/matcha/pkg/rctx"
"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/rctx"
"github.com/decentplatforms/matcha/pkg/router"
)

type fileServer struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/hello.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package examples
import (
"net/http"

"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/router"
)

func sayHello(w http.ResponseWriter, req *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/cloudretic/matcha
module github.com/decentplatforms/matcha

go 1.20
4 changes: 2 additions & 2 deletions pkg/adapter/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net/url"
"testing"

"github.com/cloudretic/matcha/pkg/route"
"github.com/cloudretic/matcha/pkg/router"
"github.com/decentplatforms/matcha/pkg/route"
"github.com/decentplatforms/matcha/pkg/router"
)

/*
Expand Down
2 changes: 1 addition & 1 deletion pkg/cors/cors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package cors defines a set of useful handlers and middleware for setting access control values.
//
// See [https://github.com/cloudretic/matcha/blob/main/docs/other-features.md#cross-origin-resource-sharing-cors].
// See [https://github.com/decentplatforms/matcha/blob/main/docs/other-features.md#cross-origin-resource-sharing-cors].
package cors

import (
Expand Down
2 changes: 1 addition & 1 deletion pkg/cors/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cors
import (
"net/http"

"github.com/cloudretic/matcha/pkg/middleware"
"github.com/decentplatforms/matcha/pkg/middleware"
)

// CORS middleware
Expand Down
2 changes: 1 addition & 1 deletion pkg/middleware/middleware.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package middleware defines the middleware format for Matcha.
//
// See [https://github.com/cloudretic/matcha/blob/main/docs/routers.md#middleware].
// See [https://github.com/decentplatforms/matcha/blob/main/docs/routers.md#middleware].
package middleware

import (
Expand Down
10 changes: 5 additions & 5 deletions pkg/middleware/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ func TestLogRequests(t *testing.T) {
}

func TestLogRequestsIf(t *testing.T) {
t.Run("log request with origin cloudretic.com", func(t *testing.T) {
t.Run("log request with origin decentplatforms.com", func(t *testing.T) {
var builder strings.Builder
mw := LogRequestsIf(func(r *http.Request) bool {
return r.Header.Get("Origin") == "cloudretic.com"
return r.Header.Get("Origin") == "decentplatforms.com"
}, &builder)
w := httptest.NewRecorder()
req := httptest.NewRequest(http.MethodGet, "https://example.com/", nil)
req.Header.Set("Origin", "cloudretic.com")
req.Header.Set("Origin", "decentplatforms.com")
req = ExecuteMiddleware([]Middleware{mw}, w, req)
if req == nil {
t.Fatal("request was nil, should be unchanged")
Expand All @@ -102,9 +102,9 @@ func TestLogRequestsIf(t *testing.T) {
if err != nil {
t.Errorf("error parsing log entry: %v", err)
}
if log.Origin != "cloudretic.com" {
if log.Origin != "decentplatforms.com" {
t.Errorf(
"log should have an origin of cloudretic.com, got %s",
"log should have an origin of decentplatforms.com, got %s",
log.Origin,
)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/middleware/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

"github.com/cloudretic/matcha/pkg/regex"
"github.com/decentplatforms/matcha/pkg/regex"
)

// ExpectQueryParam checks for the presence of a query parameter.
Expand Down
2 changes: 1 addition & 1 deletion pkg/rctx/rctx.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package rctx defines the context structure for Matcha.
//
// See [https://github.com/cloudretic/matcha/blob/main/docs/context.md].
// See [https://github.com/decentplatforms/matcha/blob/main/docs/context.md].
package rctx

import (
Expand Down
4 changes: 2 additions & 2 deletions pkg/regex/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ type pmf func(string, int) int

// Patterns are a combination of static string components and regex validation.
// Any piece of the string contained in brackets {} will be matched as regex, while any outside of brackets
// will be matched as itself; for example, {.*}.cloudretic.{.*} matches any subdomain and top-level domain for
// cloudretic. Patterns *must* contain some regex. It performs generally equivalent to the exact same regex in
// will be matched as itself; for example, {.*}.decentplatforms.{.*} matches any subdomain and top-level domain for
// decentplatforms. Patterns *must* contain some regex. It performs generally equivalent to the exact same regex in
// brackets (see regex_bench_test.go) and better if static string parts are swapped out of the expression entirely.
type Pattern struct {
fs []pmf
Expand Down
12 changes: 6 additions & 6 deletions pkg/regex/pattern_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ func use(any) {}

func BenchmarkHostPattern(b *testing.B) {
b.Run("regexp.Regexp", func(b *testing.B) {
expr := regexp.MustCompile(`.+\.cloudretic\..+`)
expr := regexp.MustCompile(`.+\.decentplatforms\..+`)
for i := 0; i < b.N; i++ {
use(expr.MatchString("www.cloudretic.com"))
use(expr.MatchString("www.decentplatforms.com"))
}
})
b.Run("regex.Pattern-full", func(b *testing.B) {
rs, isrs, err := CompilePattern(`{.+\.cloudretic\..+}`)
rs, isrs, err := CompilePattern(`{.+\.decentplatforms\..+}`)
if err != nil || !isrs {
b.Fatal(err)
}
for i := 0; i < b.N; i++ {
use(rs.Match("www.cloudretic.com"))
use(rs.Match("www.decentplatforms.com"))
}
})
b.Run("regex.Pattern-partial", func(b *testing.B) {
rs, isrs, err := CompilePattern(`{.+}.cloudretic.{.+}`)
rs, isrs, err := CompilePattern(`{.+}.decentplatforms.{.+}`)
if err != nil || !isrs {
b.Fatal(err)
}
for i := 0; i < b.N; i++ {
use(rs.Match("www.cloudretic.com"))
use(rs.Match("www.decentplatforms.com"))
}
})
}
Loading

0 comments on commit fe9a5c8

Please sign in to comment.