grpclog

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcLog

type GrpcLog struct {
	Entries []GrpcLogEntry `json:"entries"`
}

func LoadLog

func LoadLog(path string) (*GrpcLog, error)

func ParseLog

func ParseLog(log []byte) (*GrpcLog, error)

func (*GrpcLog) Attaches

func (l *GrpcLog) Attaches() ([]TypedEntry[rpc.PluginAttach, emptypb.Empty], error)

func (*GrpcLog) Calls

func (*GrpcLog) Cancels

func (l *GrpcLog) Cancels() ([]TypedEntry[emptypb.Empty, emptypb.Empty], error)

func (*GrpcLog) CheckConfigs

func (l *GrpcLog) CheckConfigs() ([]TypedEntry[rpc.CheckRequest, rpc.CheckResponse], error)

func (*GrpcLog) Checks

func (*GrpcLog) Configures

func (*GrpcLog) Constructs

func (*GrpcLog) Creates

func (*GrpcLog) Deletes

func (l *GrpcLog) Deletes() ([]TypedEntry[rpc.DeleteRequest, emptypb.Empty], error)

func (*GrpcLog) DiffConfigs

func (l *GrpcLog) DiffConfigs() ([]TypedEntry[rpc.DiffRequest, rpc.DiffResponse], error)

func (*GrpcLog) Diffs

func (*GrpcLog) GetMappings

func (*GrpcLog) GetMappingsEntries

func (l *GrpcLog) GetMappingsEntries() ([]TypedEntry[rpc.GetMappingsRequest, rpc.GetMappingsResponse], error)

func (*GrpcLog) GetPluginInfos

func (l *GrpcLog) GetPluginInfos() ([]TypedEntry[emptypb.Empty, rpc.PluginInfo], error)

func (*GrpcLog) GetSchemas

func (l *GrpcLog) GetSchemas() ([]TypedEntry[emptypb.Empty, rpc.GetSchemaResponse], error)

func (*GrpcLog) Invokes

func (*GrpcLog) Marshal

func (l *GrpcLog) Marshal() ([]byte, error)

func (*GrpcLog) Reads

func (*GrpcLog) Updates

func (*GrpcLog) WhereMethod

func (l *GrpcLog) WhereMethod(method Method) []GrpcLogEntry

func (*GrpcLog) WriteTo

func (l *GrpcLog) WriteTo(path string) error

WriteTo writes the log to the given path. Creates any directories needed.

type GrpcLogEntry

type GrpcLogEntry struct {
	// The gRPC method being called.
	// This is the full method name, e.g. "/pulumirpc.ResourceProvider/Check".
	Method   string          `json:"method"`
	Request  json.RawMessage `json:"request,omitempty"`
	Response json.RawMessage `json:"response,omitempty"`
}

type Method

type Method string
const (
	Attach        Method = "/pulumirpc.ResourceProvider/Attach"
	Call          Method = "/pulumirpc.ResourceProvider/Call"
	Cancel        Method = "/pulumirpc.ResourceProvider/Cancel"
	Check         Method = "/pulumirpc.ResourceProvider/Check"
	CheckConfig   Method = "/pulumirpc.ResourceProvider/CheckConfig"
	Configure     Method = "/pulumirpc.ResourceProvider/Configure"
	Construct     Method = "/pulumirpc.ResourceProvider/Construct"
	Create        Method = "/pulumirpc.ResourceProvider/Create"
	Delete        Method = "/pulumirpc.ResourceProvider/Delete"
	Diff          Method = "/pulumirpc.ResourceProvider/Diff"
	DiffConfig    Method = "/pulumirpc.ResourceProvider/DiffConfig"
	GetMapping    Method = "/pulumirpc.ResourceProvider/GetMapping"
	GetMappings   Method = "/pulumirpc.ResourceProvider/GetMappings"
	GetPluginInfo Method = "/pulumirpc.ResourceProvider/GetPluginInfo"
	GetSchema     Method = "/pulumirpc.ResourceProvider/GetSchema"
	Invoke        Method = "/pulumirpc.ResourceProvider/Invoke"
	Read          Method = "/pulumirpc.ResourceProvider/Read"
	Update        Method = "/pulumirpc.ResourceProvider/Update"
)

type TypedEntry

type TypedEntry[TRequest any, TResponse any] struct {
	Request  TRequest
	Response TResponse
}

func FindByURN added in v0.0.11

func FindByURN[TRequest resourceRequest, TResponse resourceResponse](entries []TypedEntry[TRequest, TResponse],
	urn string) (*TypedEntry[TRequest, TResponse], int)

FindByURN finds the first entry with the given resource URN, or nil if none is found. Returns the index of the entry, if found.

Jump to

Keyboard shortcuts

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