lib

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

README

Golang常用函数库

包中的所有函数都源于开发过程中的积累

获取

$ go get -v gopkg.in/LyricTian/lib.v1

License

Copyright 2016.All rights reserved.

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// ToString Convert interface{} to string
	ToString() string
	// ToBytes Convert interface{} to []byte
	ToBytes() []byte
	// ToString Convert interface{} to int64
	ToInt64() int64
	// ToString Convert interface{} to int32
	ToInt32() int32
	// ToString Convert interface{} to int
	ToInt() int
	// ToString Convert interface{} to uint64
	ToUint64() uint64
	// ToString Convert interface{} to uint32
	ToUint32() uint32
	// ToString Convert interface{} to float64
	ToFloat64() float64
	// ToString Convert interface{} to float32
	ToFloat32() float32
	// ToString Convert interface{} to bool
	ToBool() bool
	// ToString Convert interface{} to time,
	// // If error isn't nil return time.Now()
	ToTime(layout string) time.Time
}

Interface Provide a interface{} convert operation

func T

func T(v interface{}) Interface

T Interface instance

type Str

type Str string

Str Provide a string convert operation

func (Str) ToBool

func (s Str) ToBool() bool

ToBool Convert string to bool

func (Str) ToBuffer

func (s Str) ToBuffer() *bytes.Buffer

ToBuffer Convert string to buffer

func (Str) ToBytes

func (s Str) ToBytes() []byte

ToByte Convert string to []byte

func (Str) ToFloat32

func (s Str) ToFloat32() float32

ToFloat32 Convert string to float32

func (Str) ToFloat64

func (s Str) ToFloat64() float64

ToFloat64 Convert string to float64

func (Str) ToInt

func (s Str) ToInt() int

ToInt Convert string to int

func (Str) ToInt32

func (s Str) ToInt32() int32

ToInt32 Convert string to int32

func (Str) ToInt64

func (s Str) ToInt64() int64

ToInt64 Convert string to int64

func (Str) ToString

func (s Str) ToString() string

ToString Convert string to string

func (Str) ToTime

func (s Str) ToTime(layout string) time.Time

ToTime Convert string to time, If error isn't nil return time.Now()

func (Str) ToUint32

func (s Str) ToUint32() uint32

ToUint32 Convert string to uint32

func (Str) ToUint64

func (s Str) ToUint64() uint64

ToUint64 Convert string to uint64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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