mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-04-14 05:21:47 -05:00
* chore: log when enqueue errors * feat: standardize and improve actor model * feat: track entire surface * chore: remove heartbeats * cleanup * fix: merge * chore: cleanup and AI * fix: getter * chore: feedback * flush mu * feat: source attribute * feat: cli source * fix: webhook * feat: add server url
33 lines
807 B
Go
33 lines
807 B
Go
// Deprecated: This package is part of the legacy v0 workflow definition system.
|
|
// Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go
|
|
package client
|
|
|
|
import (
|
|
grpcMetadata "google.golang.org/grpc/metadata"
|
|
|
|
"context"
|
|
)
|
|
|
|
type contextLoader struct {
|
|
Token string
|
|
extraMD map[string]string
|
|
}
|
|
|
|
func newContextLoader(token string, extraMD map[string]string) *contextLoader {
|
|
return &contextLoader{
|
|
Token: token,
|
|
extraMD: extraMD,
|
|
}
|
|
}
|
|
|
|
func (c *contextLoader) newContext(ctx context.Context) context.Context {
|
|
pairs := map[string]string{
|
|
"authorization": "Bearer " + c.Token,
|
|
}
|
|
for k, v := range c.extraMD {
|
|
pairs[k] = v
|
|
}
|
|
md := grpcMetadata.New(pairs)
|
|
return grpcMetadata.NewOutgoingContext(ctx, md)
|
|
}
|