helper

package
v0.0.0-...-aa01819 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2021 Wei (Sam) Wang <sam.wang.0723@gmail.com>

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 (
	TB                       = 1000000000000
	GB                       = 1000000000
	MB                       = 1000000
	KB                       = 1000
	TimeZone                 = "Asia/Taipei"
	TwseDateFormat           = "20060102"
	TpexDateFormat           = "2006/01/02"
	StakeConcentrationFormat = "2006-01-02"
	Signature                = `` /* 562-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func Bytes2String

func Bytes2String(b []byte) string

func Diff

func Diff(slice1, slice2 []string) []string

func EncodeBig5

func EncodeBig5(s []byte) ([]byte, error)

func FormalizeValidTimeWithLocation

func FormalizeValidTimeWithLocation(input time.Time, offset ...int32) *time.Time

func GetCurrentEnv

func GetCurrentEnv() string

func GetDateFromOffset

func GetDateFromOffset(offset int32, format string, input ...time.Time) string

func GetDateFromUTC

func GetDateFromUTC(timestamp, format string) string

func GetReadableSize

func GetReadableSize(length, decimals int) string

func IncludeWeekend

func IncludeWeekend() bool

func IsInteger

func IsInteger(v string) bool

func ReadFromFile

func ReadFromFile(fileName string) (string, error)

func String2Bytes

func String2Bytes(s string) []byte

func ToFloat32

func ToFloat32(v string) float32

func ToInt64

func ToInt64(v string) int64

func ToUint64

func ToUint64(v string) uint64

func UnifiedDateFormatToTpex

func UnifiedDateFormatToTpex(input string) string

func UnifiedDateFormatToTwse

func UnifiedDateFormatToTwse(input string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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