()
| 37 | } |
| 38 | |
| 39 | func ExampleOfCreateByAnyLambda() { |
| 40 | // input 和 output 类型为自定义的任何类型 |
| 41 | lambda, _ := compose.AnyLambda( |
| 42 | // Invoke 函数 |
| 43 | func(ctx context.Context, input string, opts ...MyOption) (output string, err error) { |
| 44 | // some logic |
| 45 | return "", nil |
| 46 | }, |
| 47 | // Stream 函数 |
| 48 | func(ctx context.Context, input string, opts ...MyOption) (output *schema.StreamReader[string], err error) { |
| 49 | // some logic |
| 50 | return nil, nil |
| 51 | }, |
| 52 | // Collect 函数 |
| 53 | func(ctx context.Context, input *schema.StreamReader[string], opts ...MyOption) (output string, err error) { |
| 54 | // some logic |
| 55 | return "", nil |
| 56 | }, |
| 57 | // Transform 函数 |
| 58 | func(ctx context.Context, input *schema.StreamReader[string], opts ...MyOption) (output *schema.StreamReader[string], err error) { |
| 59 | // some logic |
| 60 | return nil, nil |
| 61 | }, |
| 62 | ) |
| 63 | _ = lambda |
| 64 | } |
| 65 | |
| 66 | func ExampleOfCreateByInvokableLambdaWithOptions() { |
| 67 | lambda := compose.InvokableLambdaWithOption( |
nothing calls this directly
no outgoing calls
no test coverage detected