utils

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2020 newtbig Author. 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.

Copyright 2020 newtbig Author. 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.

Copyright 2020 newtbig Author. 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.

Copyright 2020 newtbig Author. 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.

Index

Constants

View Source
const (
	PRERNG = 1024
)

Variables

View Source
var (
	LCG chan uint32
)
View Source
var Msg1Pool = sync.Pool{
	New: func() interface{} {
		return new(framepb.Msg)
	},
}

Functions

func Cause added in v0.1.4

func Cause(err error) error

func Get

func Get() *framepb.Msg

func Int64MaxBetween

func Int64MaxBetween(a, b int64) int64

func IsTimeoutError added in v0.1.4

func IsTimeoutError(err error) bool

func Put

func Put(msg *framepb.Msg)

func RandBetween

func RandBetween(min, max int) int

func SafeGO

func SafeGO(fun func())

func Uint32MaxBetween

func Uint32MaxBetween(a, b uint32) uint32

func Uint32MinBetween

func Uint32MinBetween(a, b uint32) uint32

Types

type Timer

type Timer struct {
	Time     time.Time
	Interval int
}

func NewTimer

func NewTimer(interval int) *Timer

func (*Timer) AddRandomMillisec

func (c *Timer) AddRandomMillisec(maxms int)

func (*Timer) Run

func (c *Timer) Run() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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