# タイムゾーン設定
$ sudo timedatectl set-timezone Asia/Tokyo
# Graphiteインストール
$ sudo apt update && sudo apt install -y apache2 libapache2-mod-wsgi graphite-web graphite-carbon python-whisper
$ sudo rm -f /etc/apache2/sites-enabled/000-default.conf
$ sudo ln -s /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-enabled/
$ sudo systemctl restart apache2
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 ( | |
"github.com/AliyunContainerService/image-syncer/pkg/sync" | |
"github.com/AliyunContainerService/image-syncer/pkg/tools" | |
"github.com/sirupsen/logrus" | |
) | |
func main() { | |
logger := logrus.New() |
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 ( | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"mime/multipart" | |
"net/http" | |
"os" |
func Encode(w io.Writer, m image.Image, o *Options) error {
引数w
にio.Writer
インターフェースを実装している型の変数を取る。
var e encoder
if ww, ok := w.(writer); ok {
e.w = ww
func Decode(r io.Reader) (Image, string, error) {
os.File
などのio.Reader
インターフェースを実装している型の変数を引数に取る。
rr := asReader(r)