dive

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PropBackgroundJobID = "bg_job_id"
	PropGrpcType        = "grpc_type"
	PropGrpcTypeUnary   = "unary"
	PropGrpcTypeStream  = "stream"
	PropGrpcService     = "grpc_service"
	PropGrpcMethod      = "grpc_method"
)

Variables

This section is empty.

Functions

func ActivityToContext

func ActivityToContext(ctx context.Context, a *Activity) context.Context

func ActivityToProto added in v0.1.3

func ActivityToProto(a *Activity) *diveContracts.Activity

func EventToProto added in v0.1.3

func EventToProto(e Event) *diveContracts.Activity_Event

func StreamServerInterceptor

func StreamServerInterceptor(master *Master) grpc.StreamServerInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor(master *Master) grpc.UnaryServerInterceptor

Types

type Activity

type Activity struct {
	// contains filtered or unexported fields
}

func ActivityFromContext

func ActivityFromContext(ctx context.Context) *Activity

func ActivityFromProto added in v0.1.3

func ActivityFromProto(a *diveContracts.Activity) *Activity

func NewBackgroundActivity

func NewBackgroundActivity(req any, jobID string) *Activity

func NewStreamGrpcActivity

func NewStreamGrpcActivity(service string, method string, req any) *Activity

func NewUnaryGrpcActivity

func NewUnaryGrpcActivity(service string, method string, req any) *Activity

func (*Activity) AddEvent added in v0.1.3

func (a *Activity) AddEvent(name string, ts time.Time, payload map[string]string)

func (*Activity) AddEventNow added in v0.1.3

func (a *Activity) AddEventNow(name string, payload map[string]string)

func (*Activity) Duration added in v0.1.3

func (a *Activity) Duration() time.Duration

func (*Activity) Events added in v0.1.3

func (a *Activity) Events() []Event

func (*Activity) ID added in v0.1.3

func (a *Activity) ID() string

func (*Activity) Props added in v0.1.3

func (a *Activity) Props() map[string]string

func (*Activity) Request added in v0.1.3

func (a *Activity) Request() any

func (*Activity) SetProp

func (a *Activity) SetProp(key string, value string)

func (*Activity) SetProps

func (a *Activity) SetProps(props map[string]string)

func (*Activity) SetRequest added in v0.1.3

func (a *Activity) SetRequest(req any)

func (*Activity) StartedAt added in v0.1.3

func (a *Activity) StartedAt() time.Time

type Event added in v0.1.3

type Event struct {
	// contains filtered or unexported fields
}

func EventFromProto added in v0.1.3

func EventFromProto(e *diveContracts.Activity_Event) Event

func (Event) ID added in v0.1.3

func (e Event) ID() string

func (Event) Payload added in v0.1.3

func (e Event) Payload() map[string]string

func (Event) Timestamp added in v0.1.3

func (e Event) Timestamp() time.Time

type Events added in v0.1.3

type Events []Event

type GrpcServer

type GrpcServer struct {
	diveContracts.UnimplementedDiveServiceServer
	// contains filtered or unexported fields
}

func NewGrpcServer

func NewGrpcServer(master *Master) *GrpcServer

func (*GrpcServer) Dive

type Master

type Master struct {
	// contains filtered or unexported fields
}

func NewMaster

func NewMaster() *Master

func (*Master) AddActivity

func (m *Master) AddActivity(id string, activity *Activity)

func (*Master) GetActivity

func (m *Master) GetActivity(id string) *Activity

func (*Master) RemoveActivity

func (m *Master) RemoveActivity(id string)

func (*Master) WalkActivities

func (m *Master) WalkActivities(cb func(activity *Activity))

Directories

Path Synopsis
api
go/v1
Package diveContracts is a reverse proxy.
Package diveContracts is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL