Skip to content

Commit

Permalink
support zap & std loggers also
Browse files Browse the repository at this point in the history
  • Loading branch information
jrapoport committed Jul 6, 2021
1 parent 19c9801 commit ba43ccd
Show file tree
Hide file tree
Showing 86 changed files with 3,367 additions and 2,657 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
test:
strategy:
matrix:
go-version: [ 1.15.x, 1.16.x]
go-version: [ 1.15.x, 1.16.x ]
runs-on: ubuntu-latest
steps:
- name: Install workflow dependencies
Expand All @@ -26,6 +26,6 @@ jobs:
- name: Install dependencies
run: make deps
- name: Lint and test
run: make all COVERAGE=1
run: make all COVERAGE=1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ handle user signup, authentication and custom user data.

## All NEW!

This project is a complete rewrite of [Netlify's GoTrue](https://github.com/netlify/gotrue) and is ~85-90% complete. It
This project is a complete rewrite of [Netlify's GoTrue](https://github.com/netlify/gotrue) and is ~85-90% complete. It
started off as a fork, but doesn't share a single line of code anymore.

The basic idea was to support most of the existing functionality of GoTrue while modernizing it and expanding support
Expand Down Expand Up @@ -775,13 +775,18 @@ Please see the section on [JWT](#JWT) for a more detailed explanation of these s
#### Log

```properties
GOTHIC_LOG_PACKAGE=zap
GOTHIC_LOG_LEVEL=info
GOTHIC_LOG_FILE="./logs/gothic.log"
GOTHIC_LOG_COLORS=false
GOTHIC_LOG_TIMESTAMP="Mon, 02 Jan 2006 15:04:05 -0700"
GOTHIC_LOG_FIELDS=source=gothic,priority=1
# GOTHIC_LOG_COLORS=false
# GOTHIC_LOG_TIMESTAMP="Mon, 02 Jan 2006 15:04:05 -0700"
# GOTHIC_LOG_FIELDS=source=gothic,priority=1
```

`GOTHIC_LOG_PACKAGE` - `string`

The logger to use. Possible values are: `std`, `logrus`, or `zap`. Defaults to `std`.

`GOTHIC_LOG_LEVEL` - `string`

The log level to use. Possible values are: `debug`, `info`, `warn`, `error`, `fatal`, `panic`, or `trace`. Defaults
Expand All @@ -791,7 +796,7 @@ to `info`.

The path use for a written log file. Defaults to `""` (none).

`GOTHIC_LOG_COLORS` - `boolean ("true" or "false")`
<s>`GOTHIC_LOG_COLORS` - `boolean ("true" or "false")`

If `true` logs will be color coded. Defaults to `false`.

Expand All @@ -802,7 +807,7 @@ The timestamp format to use for log entries. Defaults to `2006-01-02T15:04:05.99
`GOTHIC_LOG_FIELDS` - `comma seperated string array of key value pairs`

A comma separated string of the fields to include for log entries. Format should be a comma separated list of key/value
pared. Defaults to `""` (none).
pared. Defaults to `""` (none).</s>

#### Tracer

Expand Down Expand Up @@ -1400,7 +1405,7 @@ These changes allow for advances like self-contained database migration, expande
PostgreSQL), and gRPC support. Broadly speaking, they are intended to make it easier to modify and use the microservice
outside of Netlify tool chain, and in a more active development environment.

Since this project shares no code with GoTrue and is only conceptually similar at this point, I might truncate the
Since this project shares no code with GoTrue and is only conceptually similar at this point, I might truncate the
commit history for clarity in the future.

While the Netlify team did a good job with GoTrue, their use in production means they cannot easily adopt these kinds of
Expand Down
204 changes: 102 additions & 102 deletions api/grpc/web/account_grpc_web_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,112 +6,112 @@ import * as account_pb from './account_pb';


export class AccountClient {
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: any; });

signup(
request: account_pb.SignupRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.UserResponse) => void
): grpcWeb.ClientReadableStream<response_pb.UserResponse>;

sendConfirmUser(
request: account_pb.SendConfirmRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

confirmUser(
request: account_pb.ConfirmUserRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.BearerResponse) => void
): grpcWeb.ClientReadableStream<response_pb.BearerResponse>;

login(
request: account_pb.LoginRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.UserResponse) => void
): grpcWeb.ClientReadableStream<response_pb.UserResponse>;

logout(
request: account_pb.LogoutRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

sendResetPassword(
request: account_pb.ResetPasswordRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

confirmResetPassword(
request: account_pb.ConfirmPasswordRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.BearerResponse) => void
): grpcWeb.ClientReadableStream<response_pb.BearerResponse>;

refreshBearerToken(
request: account_pb.RefreshTokenRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.BearerResponse) => void
): grpcWeb.ClientReadableStream<response_pb.BearerResponse>;
constructor(hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: any; });

signup(
request: account_pb.SignupRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.UserResponse) => void
): grpcWeb.ClientReadableStream<response_pb.UserResponse>;

sendConfirmUser(
request: account_pb.SendConfirmRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

confirmUser(
request: account_pb.ConfirmUserRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.BearerResponse) => void
): grpcWeb.ClientReadableStream<response_pb.BearerResponse>;

login(
request: account_pb.LoginRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.UserResponse) => void
): grpcWeb.ClientReadableStream<response_pb.UserResponse>;

logout(
request: account_pb.LogoutRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

sendResetPassword(
request: account_pb.ResetPasswordRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

confirmResetPassword(
request: account_pb.ConfirmPasswordRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.BearerResponse) => void
): grpcWeb.ClientReadableStream<response_pb.BearerResponse>;

refreshBearerToken(
request: account_pb.RefreshTokenRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: response_pb.BearerResponse) => void
): grpcWeb.ClientReadableStream<response_pb.BearerResponse>;

}

export class AccountPromiseClient {
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: any; });

signup(
request: account_pb.SignupRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.UserResponse>;

sendConfirmUser(
request: account_pb.SendConfirmRequest,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;

confirmUser(
request: account_pb.ConfirmUserRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.BearerResponse>;

login(
request: account_pb.LoginRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.UserResponse>;

logout(
request: account_pb.LogoutRequest,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;

sendResetPassword(
request: account_pb.ResetPasswordRequest,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;

confirmResetPassword(
request: account_pb.ConfirmPasswordRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.BearerResponse>;

refreshBearerToken(
request: account_pb.RefreshTokenRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.BearerResponse>;
constructor(hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: any; });

signup(
request: account_pb.SignupRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.UserResponse>;

sendConfirmUser(
request: account_pb.SendConfirmRequest,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;

confirmUser(
request: account_pb.ConfirmUserRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.BearerResponse>;

login(
request: account_pb.LoginRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.UserResponse>;

logout(
request: account_pb.LogoutRequest,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;

sendResetPassword(
request: account_pb.ResetPasswordRequest,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;

confirmResetPassword(
request: account_pb.ConfirmPasswordRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.BearerResponse>;

refreshBearerToken(
request: account_pb.RefreshTokenRequest,
metadata?: grpcWeb.Metadata
): Promise<response_pb.BearerResponse>;

}

Loading

0 comments on commit ba43ccd

Please sign in to comment.