This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package jws | |
| import ( | |
| "bytes" | |
| "crypto" | |
| "crypto/rsa" | |
| _ "crypto/sha256" | |
| "encoding/base64" | |
| "encoding/binary" | |
| "math/big" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Certificate: | |
| Data: | |
| Version: 3 (0x2) | |
| Serial Number: | |
| 6a:4a:0f:86:8d:0c:26:be:7a | |
| Signature Algorithm: sha256WithRSAEncryption | |
| Issuer: CN=dev-ejtl988w.auth0.com | |
| Validity | |
| Not Before: Oct 29 22:07:22 2019 GMT | |
| Not After : Jul 7 22:07:22 2033 GMT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package jws | |
| import ( | |
| "bytes" | |
| "crypto" | |
| "crypto/rsa" | |
| _ "crypto/sha256" | |
| "crypto/x509" | |
| "encoding/base64" | |
| "encoding/binary" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| "net/http/httptest" | |
| "net/http/httputil" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "net/http/httptest" | |
| "net/http/httputil" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unc runTestServer() string { | |
| slowServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
| incoming, _ := httputil.DumpRequest(r, false) | |
| fmt.Printf("Server: Incoming Request %s", string(incoming)) | |
| ctx := r.Context() | |
| echan := make(chan error) | |
| go func() { | |
| time.Sleep(12 * time.Second) // Do difficult Job | |
| _, err := w.Write([]byte("Hello There!")) | |
| echan <- err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func writeOps(outfile string) error { | |
| f, err := os.OpenFile(outfile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) | |
| if err != nil { | |
| log.Fatalf("Failed to create file %s", err.Error()) | |
| } | |
| defer f.Close() | |
| op1 := &typedefs.Patch_Copy{Start: 10, End: 100} | |
| op2 := &typedefs.Patch_Insert{RawBytes: []byte{'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e'}} | |
| ops := []*typedefs.Patch{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax='proto3'; | |
| package typedefs; | |
| option go_package ='./typedefs'; | |
| message Patch{ | |
| message Copy{ | |
| int64 start =1; | |
| int64 end=2; | |
| } | |
| message Insert{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func readOps(outfile string) error { | |
| in, err := ioutil.ReadFile(outfile) | |
| if err != nil { | |
| return err | |
| } | |
| instructions := &typedefs.Instructions{} | |
| if err := proto.Unmarshal(in, instructions); err != nil { | |
| return err | |
| } | |
| for _, patch := range instructions.Operations { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func serializeBookDataset(protoOutFile string) error { | |
| w, err := os.OpenFile(protoOutFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) | |
| if err != nil { | |
| return err | |
| } | |
| defer w.Close() | |
| csvFile, err := os.Open("books.csv") | |
| if err != nil { | |
| return err |
OlderNewer