This file contains 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 ( | |
"bufio" | |
"bytes" | |
"context" | |
"encoding/json" | |
"github.com/pkg/errors" | |
"io" | |
"k8s.io/apimachinery/pkg/api/meta" |
This file contains 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" | |
"math/rand" | |
"strings" | |
"time" | |
"unsafe" | |
) |
This file contains 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 ( | |
"context" | |
"fmt" | |
"k8s.io/client-go/kubernetes" | |
"k8s.io/client-go/tools/clientcmd" | |
"github.com/kubeclipper/kubeclipper/pkg/utils/cmdutil" |
This file contains 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" | |
/* | |
// 前景 背景 颜色 | |
// --------------------------------------- | |
// 30 40 黑色 | |
// 31 41 红色 | |
// 32 42 绿色 |
This file contains 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" | |
"sync" | |
"time" | |
) | |
/** | |
*ticker只要定义完成,从此刻开始计时,不需要任何其他的操作,每隔固定时间都会触发。 |
This file contains 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" | |
"math" | |
"sync" | |
) | |
func echo(nums []int) <-chan int { | |
out := make(chan int) |
This file contains 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" | |
"reflect" | |
) | |
func Transform(slice, function interface{}) interface{} { | |
return transform(slice, function, false) | |
} |
This file contains 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
#!/bin/bash | |
CERTS=$PWD/cert | |
ETCD_IMAGE=k8s.gcr.io/etcd:3.4.3-0 | |
NODE1=(node1 192.168.234.130:2379 192.168.234.130:2380 127.0.0.1:2381) | |
NODE2=(node2 192.168.234.130:3379 192.168.234.130:3380 127.0.0.1:3381 node2=https://192.168.234.130:3380,node1=https://192.168.234.130:2380) | |
NODE3=(node3 192.168.234.130:4379 192.168.234.130:4380 127.0.0.1:4381 node3=https://192.168.234.130:4380,node2=https://192.168.234.130:3380,node1=https://192.168.234.130:2380) |
This file contains 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 ( | |
"bufio" | |
"fmt" | |
"github.com/billcobbler/casbin-redis-watcher/v2" | |
"github.com/casbin/casbin/v2" | |
gormadapter "github.com/casbin/gorm-adapter/v3" | |
"github.com/x893675/kubecaas/pkg/client/database" | |
"os" |
This file contains 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 ( | |
"crypto/rand" | |
"fmt" | |
"math/big" | |
) | |
const ( |
NewerOlder