// https://go.dev/play/p/CxJf4Jf9rDZ | |
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
const ZZZZ = 18279 + 456975 |
#Should be a job too :-D | |
# With xargs (on all namespaces) | |
kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\t"}{.metadata.namespace}{"\n"}{end}' --all-namespaces | \ | |
xargs -n2 sh -c 'kubectl delete jobs $0 --namespace=$1' | |
# For loop (only in the current namespace) | |
for i in $(kc get jobs -o=jsonpath='{range .items[?(@.status.conditions[0].type == "Failed")]}{.metadata.name}{"\n"}{end}'); | |
do kubectl delete jobs $i; done |
From https://stackoverflow.com/questions/47134293/compare-structs-except-one-field-golang
One option would be to group fields that should take part in the comparison into a different struct which you can embed in your original. When doing the comparison, just compare the embedded fields:
type Person struct {
Name string
Age int
}
- Is GraphQL Still Relevant in an HTTP2 World?
- GraphQL Is a Trap?
- Vulcain Comparison with GraphQL and Other API Formats
- How Multiplexing Changes Your HTTP APIs
- GraphQL kinda sucks
- Let's Stop Building APIs Around a Network Hack
- Does HTTP Multiplexing Make GraphQL Obsolete?
- GraphQL OpenAPI
- GraphQL vs gRPC
In Go, usually an HTTP client is:
type doer interface {
Do(req *http.Request) (*http.Response, error)
}
Go's HTTP situation is that the http.RoundTripper
interface is explicitly designed to provide customization of how an HTTP request executes,as that's exactly what it's there for.
If you take a look at the definition of RoundTripper and compare it to the doer
interface above, I think you'll see that the similarity is striking:
In a Five Room Dungeon, the basic formula is:
- Entrance or Guardian
- Puzzle or Roleplaying Challenge
- Trick or Setback
- Climax, Big Battle, or Conflict
- Reward, Revelation, or Plot Twist
https://github.com/lf-edge/eve-libs/blob/main/reconciler/README.md | |
https://github.com/spotahome/gontroller |
// Gets the latest Apollo Embedded Sandbox Playground URL from the CDN S3 bucket | |
// | |
// To get the Subresource Integrity check, `go run main.go` and take what that outputs and run like this: | |
// CDN_FILE=https://embeddable-sandbox.cdn.apollographql.com/58165cf7452dbad480c7cb85e7acba085b3bac1d/embeddable-sandbox.umd.production.min.js | |
// curl -s $CDN_FILE | openssl dgst -sha256 -binary | openssl base64 -A; echo | |
package main | |
import ( | |
"encoding/xml" |
sqlc isn’t an ORM, but it implements one of the most useful features of one – mapping a query back into a struct without the need for boilerplate. If you have query with a SELECT * or RETURNING *, it knows which fields a table is supposed to have, and emits the result to a standard struct representing its records. All queries for a particular table that return its complete set of fields get to share the same output struct.
Rather than implement its own partially-complete SQL parser, sqlc uses PGAnalyze’s excellent pg_query_go, which bakes in the same query parser that Postgres really uses. It’s never given me trouble so far – even complex queries with unusual Postgres embellishments work.
This query parsing also gives you some additional pre-runtime code verification. It won’t protect you against logical bugs, but it won’t compile invalid SQL queries, which is a far shot better than the guarantees you get with SQL-in-Go-strings. And thanks to SQL’s declarative nature, it tends to produce fewer bugs than com