common

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = logrus.New()

Functions

func ComputeSHA256

func ComputeSHA256(data []string) string

func CreateDirIfMissing

func CreateDirIfMissing(dirPath string) error

func CryptoRandomGeneration

func CryptoRandomGeneration(min int64, max int64) int64

func Deserialize

func Deserialize(serializedBytes []byte, object interface{}) error

func DirEmpty

func DirEmpty(dirPath string) (bool, error)

DirEmpty returns true if the dir at dirPath is empty

func GetLogger

func GetLogger(name string) *logrus.Entry

func Serialize

func Serialize(object interface{}) ([]byte, error)

* gob encoder로 인코딩했을 때 문제점 1. empty slice(make 로 생성한거) 가 디코딩하면 nil 로 디코딩 됨. ㄴ json marshal로 바꾸면서 해결 2. time.Time 값들은 뒤에 monotonic 파트가 없어짐. 2번은 문제가 안 될수도 있는데 테스트 실패의 원인..

func ToEnvelope

func ToEnvelope(data interface{}, crpyto auth.Crypto, pubkey []byte) message.Envelope

이렇게 하는것이 과연 최선일까?..

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL