utils

package
v0.0.0-...-72e79e1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2016, Cossack Labs Limited

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, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	NOT_FOUND = -1
)
View Source
const (
	SESSION_DATA_LIMIT = 8 * 1024 // 8 kb
)
View Source
const (
	SLASH_CHAR = 92
)

Variables

View Source
var ErrBigDataBlockSize = fmt.Errorf("Block size greater than %v", SESSION_DATA_LIMIT)

Functions

func AbsPath

func AbsPath(path string) (string, error)

func ErrorMessage

func ErrorMessage(msg string, err error) string

function for standartizing custom messages with messages from error

func FileExists

func FileExists(path string) (bool, error)

func FillSlice

func FillSlice(value byte, data []byte)

func FindTag

func FindTag(symbol byte, count int, block []byte) int

func GetConfigPathByName

func GetConfigPathByName(name string) string

func IsPrintableEscapeChar

func IsPrintableEscapeChar(c byte) bool

return true if character is ascii printable (code between 32 and 126)

func LoadPrivateKey

func LoadPrivateKey(path string) (*keys.PrivateKey, error)

func LoadPublicKey

func LoadPublicKey(path string) (*keys.PublicKey, error)

func Min

func Min(x, y int) int

func ReadData

func ReadData(reader io.Reader) ([]byte, error)

func ReadFile

func ReadFile(path string) ([]byte, error)

func ReadSessionData

func ReadSessionData(reader io.Reader) ([]byte, error)

func SendData

func SendData(data []byte, conn io.Writer) error

func SendSessionData

func SendSessionData(data []byte, conn io.Writer) error

func WriteFull

func WriteFull(data []byte, wr io.Writer) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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