goio

package module
v0.0.0-...-2cacd33 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2014 License: MIT Imports: 19 Imported by: 1

README

goio

IO helper utils for Golang

Getting Started

1. Add the import to your project

import (
	. "github.com/vizidrix/goio"
)

2. Start using

cert, err := MakeCert("Acme Inc.", 1024, []string{}, time.Minute * 10, false)
// 32 char key code
key := []byte("1a2a3a4a5a 1a2a3a4a5a 1a2a3a4a5a")
data := []byte("some secret information to encode")

// Do encrypt and decrypt
encrypted, _ := AesEncrypt(key, data)
decrypted, _ := AesDecrypt(key, encrypted)

Version

0.1.1 ish

Tech

  • [Go] - Golang.org
  • [GOIO] - Utility methods for Golang to help with Zip, Crypto, etc

License

https://github.com/vizidrix/goio/blob/master/LICENSE


Edited

  • 27-January-2014 refactoring AES to include Reader and Writer interfaces
  • 27-January-2014 initial release

Credits

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleSignalWs

func HandleSignalWs(key string, signalChan chan struct{}, exitChan chan struct{}) func(*websocket.Conn)

func NewIndexedWSConn

func NewIndexedWSConn(index int64) *indexedWSConn

func RawTarServer

func RawTarServer(data []byte) (*tarServer, error)

func TarServer

func TarServer(path string) (*tarServer, error)

Types

type Cert

type Cert struct {
	// contains filtered or unexported fields
}

func MakeCert

func MakeCert(organization string, size int, hosts []string, lifespan time.Duration, isCA bool) (*Cert, error)

func (*Cert) WritePrivate

func (cert *Cert) WritePrivate(file string) error

"certs/private.pem"

func (*Cert) WritePublic

func (cert *Cert) WritePublic(file string) error

"certs/public.pem"

type CertDefinition

type CertDefinition struct {
	Organization string
	Size         int
	Hosts        []string
	LifeSpan     time.Duration
	IsCA         bool
}

func NewCertDefinition

func NewCertDefinition(organization string, size int, hosts []string, lifespan time.Duration, isCA bool) (*CertDefinition, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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