github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/executables/derived.gen.go (about) 1 // Code generated by goderive DO NOT EDIT. 2 3 package executables 4 5 // deriveTuplePackable returns a function, which returns the input values. 6 // Since tuples are not first class citizens in Go, this is a way to fake it, because functions that return tuples are first class citizens. 7 func deriveTuplePackable(v0 *packable, v1 error) func() (*packable, error) { 8 return func() (*packable, error) { 9 return v0, v1 10 } 11 } 12 13 // deriveTupleBuilt returns a function, which returns the input values. 14 // Since tuples are not first class citizens in Go, this is a way to fake it, because functions that return tuples are first class citizens. 15 func deriveTupleBuilt(v0 Buildable, v1 error) func() (Buildable, error) { 16 return func() (Buildable, error) { 17 return v0, v1 18 } 19 } 20 21 // deriveTuplePacked returns a function, which returns the input values. 22 // Since tuples are not first class citizens in Go, this is a way to fake it, because functions that return tuples are first class citizens. 23 func deriveTuplePacked(v0 *packable, v1 *string, v2 error) func() (*packable, *string, error) { 24 return func() (*packable, *string, error) { 25 return v0, v1, v2 26 } 27 } 28 29 // deriveCurryDebug returns a function that has one parameter, which corresponds to the input functions first parameter, and a result that is a function, which takes the rest of the parameters as input and finally returns the original input function's results. 30 func deriveCurryDebug(f func(debug bool, gitCommit string, version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple)) func(debug bool) func(gitCommit string, version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 31 return func(debug bool) func(gitCommit string, version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 32 return func(gitCommit string, version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 33 return f(debug, gitCommit, version, githubClientID, githubClientSecret, bin) 34 } 35 } 36 } 37 38 // deriveCurryCommit returns a function that has one parameter, which corresponds to the input functions first parameter, and a result that is a function, which takes the rest of the parameters as input and finally returns the original input function's results. 39 func deriveCurryCommit(f func(gitCommit string, version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple)) func(gitCommit string) func(version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 40 return func(gitCommit string) func(version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 41 return func(version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 42 return f(gitCommit, version, githubClientID, githubClientSecret, bin) 43 } 44 } 45 } 46 47 // deriveCurryTag returns a function that has one parameter, which corresponds to the input functions first parameter, and a result that is a function, which takes the rest of the parameters as input and finally returns the original input function's results. 48 func deriveCurryTag(f func(version string, githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple)) func(version string) func(githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 49 return func(version string) func(githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 50 return func(githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple) { 51 return f(version, githubClientID, githubClientSecret, bin) 52 } 53 } 54 } 55 56 // deriveCurryGithubClientID returns a function that has one parameter, which corresponds to the input functions first parameter, and a result that is a function, which takes the rest of the parameters as input and finally returns the original input function's results. 57 func deriveCurryGithubClientID(f func(githubClientID string, githubClientSecret string, bin Buildable) (bt BuiltTuple)) func(githubClientID string) func(githubClientSecret string, bin Buildable) (bt BuiltTuple) { 58 return func(githubClientID string) func(githubClientSecret string, bin Buildable) (bt BuiltTuple) { 59 return func(githubClientSecret string, bin Buildable) (bt BuiltTuple) { 60 return f(githubClientID, githubClientSecret, bin) 61 } 62 } 63 } 64 65 // deriveCurryGithubClientSecret returns a function that has one parameter, which corresponds to the input functions first parameter, and a result that is a function, which takes the rest of the parameters as input and finally returns the original input function's results. 66 func deriveCurryGithubClientSecret(f func(githubClientSecret string, bin Buildable) (bt BuiltTuple)) func(githubClientSecret string) func(bin Buildable) (bt BuiltTuple) { 67 return func(githubClientSecret string) func(bin Buildable) (bt BuiltTuple) { 68 return func(bin Buildable) (bt BuiltTuple) { 69 return f(githubClientSecret, bin) 70 } 71 } 72 } 73 74 // deriveFmapBuild returns an output channel where the items are the result of the input function being applied to the items on the input channel. 75 func deriveFmapBuild(f func(Buildable) BuiltTuple, in <-chan Buildable) <-chan BuiltTuple { 76 out := make(chan BuiltTuple, cap(in)) 77 go func() { 78 for a := range in { 79 b := f(a) 80 out <- b 81 } 82 close(out) 83 }() 84 return out 85 } 86 87 // deriveFmapPackableFromBuild returns an output channel where the items are the result of the input function being applied to the items on the input channel. 88 func deriveFmapPackableFromBuild(f func(BuiltTuple) PackableTuple, in <-chan BuiltTuple) <-chan PackableTuple { 89 out := make(chan PackableTuple, cap(in)) 90 go func() { 91 for a := range in { 92 b := f(a) 93 out <- b 94 } 95 close(out) 96 }() 97 return out 98 } 99 100 // deriveFmapPackableFromFile returns an output channel where the items are the result of the input function being applied to the items on the input channel. 101 func deriveFmapPackableFromFile(f func(string) PackableTuple, in <-chan string) <-chan PackableTuple { 102 out := make(chan PackableTuple, cap(in)) 103 go func() { 104 for a := range in { 105 b := f(a) 106 out <- b 107 } 108 close(out) 109 }() 110 return out 111 } 112 113 // deriveFmapDownload returns an output channel where the items are the result of the input function being applied to the items on the input channel. 114 func deriveFmapDownload(f func(Downloadable) PackableTuple, in <-chan Downloadable) <-chan PackableTuple { 115 out := make(chan PackableTuple, cap(in)) 116 go func() { 117 for a := range in { 118 b := f(a) 119 out <- b 120 } 121 close(out) 122 }() 123 return out 124 } 125 126 // deriveFmapPack returns an output channel where the items are the result of the input function being applied to the items on the input channel. 127 func deriveFmapPack(f func(PackableTuple) packedTuple, in <-chan PackableTuple) <-chan packedTuple { 128 out := make(chan packedTuple, cap(in)) 129 go func() { 130 for a := range in { 131 b := f(a) 132 out <- b 133 } 134 close(out) 135 }() 136 return out 137 } 138 139 // deriveFmapExtractOneFile returns an output channel where the items are the result of the input function being applied to the items on the input channel. 140 func deriveFmapExtractOneFile(f func(PackableTuple) PackableTuple, in <-chan PackableTuple) <-chan PackableTuple { 141 out := make(chan PackableTuple, cap(in)) 142 go func() { 143 for a := range in { 144 b := f(a) 145 out <- b 146 } 147 close(out) 148 }() 149 return out 150 }