Skip to content

Commit

Permalink
Clean up repo (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
corentinmusard authored Apr 8, 2024
1 parent bae98cd commit 71c7d7f
Show file tree
Hide file tree
Showing 46 changed files with 109 additions and 698 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# Tilebox Go Library

This repository contains the Go library for Tilebox.

## Getting Started

### Installation

Run the following command to add the library to your project:

```bash
go get github.com/tilebox/tilebox-go
```

### Usage

Here is a minimal usage example where we create a JobClient and submit a task:

```go
package main

// TODO
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion task-runner/buf.gen.yaml → buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: v1
managed:
enabled: true
go_package_prefix:
default: github.com/tilebox/tilebox-go/task-runner/protogen/go
default: github.com/tilebox/tilebox-go/protogen/go
except:
- buf.build/googleapis/googleapis
plugins:
Expand Down
1 change: 0 additions & 1 deletion workflows-service/buf.work.yaml → buf.work.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: v1
directories:
- apis
# - apis-internal
2 changes: 1 addition & 1 deletion workflows-service/generate.go → generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package task_runner
package tilebox_go

//go:generate go run -mod=mod github.com/bufbuild/buf/cmd/buf generate
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require (
github.com/axiomhq/axiom-go v0.17.5
github.com/google/uuid v1.6.0
github.com/hashicorp/go-retryablehttp v0.7.5
github.com/integrii/flaggy v1.5.2
github.com/remychantenay/slog-otel v1.3.0
go.opentelemetry.io/otel v1.24.0
go.opentelemetry.io/otel/sdk v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
Expand Down
5 changes: 0 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69
github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84=
github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-containerregistry v0.19.1 h1:yMQ62Al6/V0Z7CqIrrS1iYoA5/oQCm88DeNujc7C1KY=
Expand All @@ -77,8 +76,6 @@ github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxC
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M=
github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/integrii/flaggy v1.5.2 h1:bWV20MQEngo4hWhno3i5Z9ISPxLPKj9NOGNwTWb/8IQ=
github.com/integrii/flaggy v1.5.2/go.mod h1:dO13u7SYuhk910nayCJ+s1DeAAGC1THCMj1uSFmwtQ8=
github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ=
github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8=
github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
Expand All @@ -105,8 +102,6 @@ github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=
github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/remychantenay/slog-otel v1.3.0 h1:mppL97agkmwR416lKzltRQ9QRhrPdxwVidt0AnI3Ts4=
github.com/remychantenay/slog-otel v1.3.0/go.mod h1:L2VAe6WOMAk/kRzzuv2B/rWe/IDXAhUNae0919b4kHU=
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package services
package grpc

import (
"connectrpc.com/connect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package services
package observability

import (
"context"
adapter "github.com/axiomhq/axiom-go/adapters/slog"
"github.com/axiomhq/axiom-go/axiom"
axiotel "github.com/axiomhq/axiom-go/axiom/otel"
workflowsv1 "github.com/tilebox/tilebox-go/workflows-service/protogen/go/workflows/v1"
workflowsv1 "github.com/tilebox/tilebox-go/protogen/go/workflows/v1"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"
Expand Down Expand Up @@ -67,15 +67,15 @@ func tracerProvider(serviceName, serviceVersion string, exporters []trace.SpanEx
return trace.NewTracerProvider(opts...)
}

func getTraceParentOfCurrentSpan(ctx context.Context) string {
func GetTraceParentOfCurrentSpan(ctx context.Context) string {
carrier := propagation.MapCarrier{}

propagator.Inject(ctx, carrier)

return carrier.Get("traceparent")
}

func startJobSpan[Result any](tracer oteltrace.Tracer, ctx context.Context, spanName string, job *workflowsv1.Job, f func(ctx context.Context) (Result, error)) (Result, error) {
func StartJobSpan[Result any](tracer oteltrace.Tracer, ctx context.Context, spanName string, job *workflowsv1.Job, f func(ctx context.Context) (Result, error)) (Result, error) {
carrier := propagation.MapCarrier{"traceparent": job.TraceParent}
ctx = propagator.Extract(ctx, carrier)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 71c7d7f

Please sign in to comment.