vim-go.txt Go development plugin vim-go
===============================================================================
| # -------------------------- Step 1: Define and install WorkloadType and Trait --------------------- | |
| --- | |
| apiVersion: core.oam.dev/v1alpha1 | |
| kind: WorkloadType | |
| metadata: | |
| name: radius | |
| spec: | |
| schematic: | |
| # CRD schema mechanism. Feel free to replace this part with json-schema or OpenAPIv3 schema. | |
| apiVersion: apiextensions.k8s.io/v1 |
| type Fang struct { | |
| total int | |
| price int | |
| weizhi int | |
| totalSize float64 | |
| defanglv float64 | |
| realSize float64 | |
| danyuan string | |
| pcon float64 | |
| } |
| func GetLocalIP() (string, error) { | |
| addrs, err := net.InterfaceAddrs() | |
| if err != nil { | |
| return "127.0.0.1", fmt.Errorf("Get local IP error: %v\n", err) | |
| } | |
| for _, address := range addrs { | |
| // check the address type and if it is not a loopback the display it | |
| if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { | |
| if ipnet.IP.To4() != nil { | |
| return ipnet.IP.String(), nil |
| #!/bin/bash | |
| case $# in | |
| 0) | |
| echo "Usage: $0 {start|stop}" | |
| exit 1 | |
| ;; | |
| 1) | |
| case $1 in | |
| start) |
| #!/bin/bash | |
| case $# in | |
| 0) | |
| echo "Usage: $0 {start|stop}" | |
| exit 1 | |
| ;; | |
| 1) | |
| case $1 in | |
| start) |
| URL=book.xjpvictor.info | |
| ANS="" | |
| for (( i=1; ; i++ )) | |
| do | |
| if [ $i = 1 ] | |
| then | |
| INDEX=`curl $URL | grep item | cut -f4 -d '"'` | |
| ANS="$ANS $INDEX" | |
| else |
| # 其中包括文件名的非法编码检测以及文件内部非法字符的检测 | |
| # 检查特定格式的文件后缀,如css,js可以修改如下: | |
| # Dir.glob(dir_files + "/**.{js,css}").each do |file|.{js,css} | |
| dirstr = "/root/ZTC/" | |
| dir = Dir.new(dirstr) | |
| dir.each do |path| | |
| next if path == "." || path == ".." | |
| dir_path = dirstr+path |
| function curenv () { | |
| if [ "$1" == "" ]; then | |
| CURENV="default" | |
| else | |
| CURENV="$(echo "$1" | cut -d '-' -f 2)" | |
| fi | |
| } | |
| function listenvs () { | |
| echo "Listing available environments..." | |
| for folder in $HOME/.cf*; do |