Skip to content

Commit

Permalink
Regenerate F# examples from new templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jskeet committed Nov 19, 2020
1 parent 31cdeb5 commit 801e87b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,14 @@ type Function() =
printfn "Storage object information:"
printfn " Name: %s" data.Name
printfn " Bucket: %s" data.Bucket
printfn " Size: %i" data.Size
printfn " Size: %A" data.Size
printfn " Content type: %s" data.ContentType
printfn "Cloud event information:"
printfn " ID: %s" cloudEvent.Id
printfn " Source: %O" cloudEvent.Source
printfn " Source: %A" cloudEvent.Source
printfn " Type: %s" cloudEvent.Type
printfn " Subject: %s" cloudEvent.Subject
printfn " DataSchema: %O" cloudEvent.DataSchema
printfn " DataContentType: %O" cloudEvent.DataContentType
printfn " Time: %s" (match Option.ofNullable cloudEvent.Time with
| Some time -> time.ToUniversalTime().ToString "yyyy-MM-dd'T'HH:mm:ss.fff'Z'"
| None -> "")
printfn " SpecVersion: %O" cloudEvent.SpecVersion

// In this example, we don't need to perform any asynchronous operations, so we
// just return an completed Task to conform to the interface.
Task.CompletedTask
printfn " DataSchema: %A" cloudEvent.DataSchema
printfn " DataContentType: %A" cloudEvent.DataContentType
printfn " SpecVersion: %A" cloudEvent.SpecVersion
Task.CompletedTask
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ type Function() =
/// <returns>A task representing the asynchronous operation.</returns>
member this.HandleAsync context =
async {
do! context.Response.WriteAsync "Hello, Functions Framework." |> Async.AwaitTask
context.Response.WriteAsync "Hello, Functions Framework." |> Async.AwaitTask |> ignore
} |> Async.StartAsTask :> _
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ type Function() =
printfn "Type: %s" cloudEvent.Type
printfn "Subject: %s" cloudEvent.Subject
printfn "DataSchema: %A" cloudEvent.DataSchema
printfn "DataContentType: %O" cloudEvent.DataContentType
printfn "Time: %s" (match Option.ofNullable cloudEvent.Time with
| Some time -> time.ToUniversalTime().ToString "yyyy-MM-dd'T'HH:mm:ss.fff'Z'"
| None -> "")
printfn "SpecVersion: %O" cloudEvent.SpecVersion
printfn "DataContentType: %A" cloudEvent.DataContentType
printfn "SpecVersion: %A" cloudEvent.SpecVersion
printfn "Data: %A" cloudEvent.Data

// In this example, we don't need to perform any asynchronous operations, so we
// just return a completed Task to conform to the interface.
Task.CompletedTask

0 comments on commit 801e87b

Please sign in to comment.