system

package
v0.0.0-...-f6ca644 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// UTCDateLayout constant
	UTCDateLayout = "2006-01-02T15:04:05Z07:00"

	FieldLabelWIB   = "WIB"
	WIBLocation     = "Asia/Jakarta"
	UTCWIBOffsetSec = 25200

	LangID Lang = "id"
	LangEN Lang = "en"
)

Variables

View Source
var DayID = []string{"Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"}
View Source
var MonthID = []string{"Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"}

Functions

func Base64RawURLDecode

func Base64RawURLDecode(msg string) string

Base64RawURLDecode function

func Base64RawURLDecodeCustom

func Base64RawURLDecodeCustom(msg string) string

Base64RawURLDecodeCustom function

func Base64RawURLEncode

func Base64RawURLEncode(msg string) string

Base64RawURLEncode function

func Base64RawURLEncodeCustom

func Base64RawURLEncodeCustom(msg string) string

Base64RawURLEncodeCustom function

func Base64decode

func Base64decode(msg string) string

Base64decode function

func Base64decodeCustom

func Base64decodeCustom(msg string) string

Base64decodeCustom function

func Base64encode

func Base64encode(msg string) string

Base64encode function

func Base64encodeCustom

func Base64encodeCustom(msg string) string

Base64encodeCustom function

func Base64urldecode

func Base64urldecode(msg string) string

Base64urldecode function

func Base64urldecodeCustom

func Base64urldecodeCustom(msg string) string

Base64urldecodeCustom function

func Base64urlencode

func Base64urlencode(msg string) string

Base64urlencode function

func Base64urlencodeCustom

func Base64urlencodeCustom(msg string) string

Base64urlencodeCustom function

func DateZToWIBID

func DateZToWIBID(utc string, lang Lang) string

DateZToWIBID function @utc should be "2020-01-23T20:00:30Z" @return "7 Maret 2015, 18:06 WIB"

func DateZToWIBIDWithDay

func DateZToWIBIDWithDay(utc string, lang Lang) string

DateZToWIBIDWithDay function @utc should be "2020-01-23T20:00:30Z" @return "Sabtu, 7 Maret 2015, 18:06 WIB"

func DecryptAes

func DecryptAes(key []byte, securemess string) (decodedmess string, err error)

DecryptAes function

func EncryptAes

func EncryptAes(key []byte, message string) (encmess string, err error)

EncryptAes function

func GetAllIP

func GetAllIP() string

GetAllIP function

func GetCurDateTimeZ

func GetCurDateTimeZ() string

GetCurDateTimeZ function

func GetCurDateTimeZAdd

func GetCurDateTimeZAdd(unit AddDateUnitName, value int) string

GetCurDateTimeZAdd function

func GetDateTimeAdd

func GetDateTimeAdd(t time.Time, unit AddDateUnitName, value int) (time.Time, error)

GetDateTimeAdd function

func GetDateTimeZAdd

func GetDateTimeZAdd(t time.Time, unit AddDateUnitName, value int) (string, error)

GetDateTimeZAdd function

func GetTimeFromUnix

func GetTimeFromUnix(unixTime int64) time.Time

GetTimeFromUnix function parameter is milliseconds int64

func GetTimeFromUnixString

func GetTimeFromUnixString(unixTime string) (time.Time, error)

GetTimeFromUnixString function parameter is milliseconds string

func GetTimeStamp

func GetTimeStamp(ts ...time.Time) int64

GetTimeStamp function return milliseconds int64

func GetTimeStampString

func GetTimeStampString(ts ...time.Time) string

GetTimeStampString function return milliseconds string

func GetUID

func GetUID() string

GetUID function

func HMACSha256

func HMACSha256(secret, stringToSign string) string

HMACSha256 function

func Md5

func Md5(msg string) string

Md5 function

func ParseDateTimeZ

func ParseDateTimeZ(value string) (time.Time, error)

ParseDateTimeZ function

func Random

func Random(min, max int) int

Random function

func Round

func Round(num float64) int

Round function

func Sha256String

func Sha256String(s string) string

Sha256String function

func Sha512String

func Sha512String(s string) string

Sha512String function

func ToFixed

func ToFixed(num float64, precision int) float64

ToFixed function

func TripleDesDecrypt

func TripleDesDecrypt(crypted, key []byte) ([]byte, error)

TripleDesDecrypt function (3DES)

func TripleDesDecryptString

func TripleDesDecryptString(cryptedString, keyString string) ([]byte, error)

TripleDesDecryptString function (3DES)

func TripleDesEncrypt

func TripleDesEncrypt(data, key []byte) ([]byte, error)

TripleDesEncrypt function (3DES)

func TripleDesEncryptString

func TripleDesEncryptString(data, keyString string) ([]byte, error)

TripleDesEncryptString function (3DES)

Types

type AddDateUnitName

type AddDateUnitName string

AddDateUnitName type

const (
	// AddYears constant
	AddYears AddDateUnitName = "years"
	// AddMonths constant
	AddMonths AddDateUnitName = "months"
	// AddDays constant
	AddDays AddDateUnitName = "days"
	// AddHours constant
	AddHours AddDateUnitName = "hours"
	// AddMinutes constant
	AddMinutes AddDateUnitName = "minutes"
	// AddSeconds constant
	AddSeconds AddDateUnitName = "seconds"
)

type Lang

type Lang string

Jump to

Keyboard shortcuts

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