<-------------------------------> 个人网站
func (s SqlTokenStore) Save(token *model.Token) store.StoreChannel {
return store.Do(func(result *store.StoreResult) {
if result.Err = token.IsValid(); result.Err != nil {
return
}
if err := s.GetMaster().Insert(token); err != nil {
result.Err = model.NewAppError("SqlTokenStore.Save", "store.sql_recover.save.app_error", nil, "", http.StatusInternalServerError)
}
This allows nodes to keep track of history and avoid tampering.
type Ledger struct {
owner NodeId
partner NodeId
bytes_sent int
bytes_recv int
timestamp Timestamp
}
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
// CallUnary | |
// [3]reflect.Value in[0] is context.Context, in[1] is your message type which generated by pb file. | |
// in[2] is grpc.CallOption | |
func (c *Client) CallUnary(methodName string,in []reflect.Value)(interface{},error) { | |
m, ok := reflect.TypeOf(c.c).MethodByName(methodName) | |
if !ok{ | |
log.Fatal("method not found") | |
return nil,errors.New("method not found") | |
} |
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
FROM ubuntu:16.04 | |
# system basics | |
RUN apt-get update && \ | |
apt-get -y --no-install-recommends install \ | |
build-essential \ | |
curl \ | |
python3 \ | |
python3-dev \ | |
python3-setuptools \ |
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
server | |
{ | |
listen 80; | |
server_name jupyter.abser.top; | |
chunked_transfer_encoding on; | |
location / { | |
proxy_pass http://127.0.0.1:8888; | |
proxy_next_upstream error timeout invalid_header http_500 http_502 http_504; |
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
// Copyright 2019 Google LLC | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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 ( | |
"encoding/xml" | |
"github.com/minio/minio-go/v7/pkg/replication" | |
"github.com/silverswords/muses.minio/bucketStorage" | |
"log" | |
) | |
func main() { |
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
func echo(wq *waiter.Queue, ep tcpip.Endpoint) { | |
defer ep.Close() | |
// Create wait queue entry that notifies a channel. | |
waitEntry, notifyCh := waiter.NewChannelEntry(nil) | |
wq.EventRegister(&waitEntry, waiter.EventIn) | |
defer wq.EventUnregister(&waitEntry) | |
for { |
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
// Copyright 2020 Gin Core Team. All rights reserved. | |
// Use of this source code is governed by a MIT style | |
// license that can be found in the LICENSE file. | |
package bytesconv | |
import ( | |
"reflect" | |
"unsafe" | |
) |
OlderNewer