(log Log)
| 378 | } |
| 379 | |
| 380 | func ProtoFromLog(log Log) (*proto.Log, error) { |
| 381 | lvl, ok := proto.Log_Level_value[strings.ToUpper(string(log.Level))] |
| 382 | if !ok { |
| 383 | return nil, xerrors.Errorf("unknown log level: %s", log.Level) |
| 384 | } |
| 385 | return &proto.Log{ |
| 386 | CreatedAt: timestamppb.New(log.CreatedAt), |
| 387 | Output: SanitizeLogOutput(log.Output), |
| 388 | Level: proto.Log_Level(lvl), |
| 389 | }, nil |
| 390 | } |
| 391 | |
| 392 | func ProtoFromLifecycle(req PostLifecycleRequest) (*proto.Lifecycle, error) { |
| 393 | s, ok := proto.Lifecycle_State_value[strings.ToUpper(string(req.State))] |
no test coverage detected