ApplyContractFromRawData applies a single contract document using the gRPC client.
(ctx context.Context, conn *grpc.ClientConn, rawData []byte)
| 115 | |
| 116 | // ApplyContractFromRawData applies a single contract document using the gRPC client. |
| 117 | func ApplyContractFromRawData(ctx context.Context, conn *grpc.ClientConn, rawData []byte) (bool, error) { |
| 118 | client := pb.NewWorkflowContractServiceClient(conn) |
| 119 | |
| 120 | resp, err := client.Apply(ctx, &pb.WorkflowContractServiceApplyRequest{ |
| 121 | RawSchema: rawData, |
| 122 | }) |
| 123 | if err != nil { |
| 124 | return false, fmt.Errorf("failed to apply contract: %w", err) |
| 125 | } |
| 126 | |
| 127 | return resp.GetChanged(), nil |
| 128 | } |
| 129 | |
| 130 | // CollectYAMLFiles returns YAML file paths from the given path. |
| 131 | // If path is a file, it returns that file. If a directory, it walks recursively. |
no test coverage detected