system

package
v0.0.0-...-d86056c Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: Apache-2.0 Imports: 12 Imported by: 8

Documentation

Overview

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.

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.

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.

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.

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.

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.

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 (
	TIMEFORMAT = "2006-01-02 15:04:05"
)
View Source
const (
	WINDOWS = "windows" // windows operating system
)

Variables

This section is empty.

Functions

func ComputNextHourTimeMillis

func ComputNextHourTimeMillis() int64

ComputNextHourTimeMillis 下一整点小时(分、秒、毫秒置为0) Author rongzhihong Since 2017/9/5

func ComputNextMinutesTimeMillis

func ComputNextMinutesTimeMillis() int64

ComputNextMinutesTimeMillis 下一整点分钟(秒、毫秒置为0) Author rongzhihong Since 2017/9/5

func ComputNextMorningTimeMillis

func ComputNextMorningTimeMillis() int64

ComputNextMorningTimeMillis 下一整点天(时、分、秒、毫秒置为0) Author rongzhihong Since 2017/9/5

func CurrentTimeMillis

func CurrentTimeMillis() int64

CurrentTimeMillis 当前时间毫秒数 Author rongzhihong Since 2017/9/5

func ExitNotify

func ExitNotify(fn func(os.Signal))

func Home

func Home() string

func IsWindowsOS

func IsWindowsOS() bool

IsWindowsOS check current os is windows if current is windows operating system, return true ; otherwise return false Author rongzhihong Since 2017/9/8

func MilliTime2String

func MilliTime2String(millisecond int64) string

MillsTime2String 将毫秒时间转为字符时间 Author: rongzhihong Since: 2017/9/19

func UnixHome

func UnixHome() string

func WindowsHome

func WindowsHome() string

Types

type Notify

type Notify struct {
	// contains filtered or unexported fields
}

Notify 唤醒Goroutine

func CreateNotify

func CreateNotify() *Notify

CreateNotify create notfiy

func (*Notify) Close

func (n *Notify) Close()

Close close c

func (*Notify) Signal

func (n *Notify) Signal()

Signal wakes one goroutine waiting on c, if there is any.

func (*Notify) Wait

func (n *Notify) Wait()

Wait cannot return unless awoken by Signal.

func (*Notify) WaitTimeout

func (n *Notify) WaitTimeout(timeout time.Duration)

WaitTimeout cannot return unless awoken by Signal or timeout.

type Ticker

type Ticker struct {
	// contains filtered or unexported fields
}

func NewTicker

func NewTicker(wait bool, delay, period time.Duration, fn func()) *Ticker

func (*Ticker) Start

func (t *Ticker) Start()

func (*Ticker) Stop

func (t *Ticker) Stop() bool

Stop stop ticker

type Tickers

type Tickers struct {
	// contains filtered or unexported fields
}

Tickers 定时器管理

func NewTickers

func NewTickers() *Tickers

NewTickers 创建定时器管理

func (*Tickers) Close

func (ts *Tickers) Close() error

Close 关闭定时器

func (*Tickers) Get

func (ts *Tickers) Get(key string) *Ticker

Get 取得定时器

func (*Tickers) Register

func (ts *Tickers) Register(key string, t *Ticker) error

Register 注册一个定时器

func (*Tickers) Remove

func (ts *Tickers) Remove(key string) error

Remove 移除定时器

func (*Tickers) Start

func (ts *Tickers) Start()

Start 开启所有定时器

type WaitNotify

type WaitNotify struct {
	// contains filtered or unexported fields
}

WaitNotify 用来做线程之间异步通知 Author zhoufei Since 2017/10/23

func NewWaitNotify

func NewWaitNotify() *WaitNotify

func (*WaitNotify) WaitForRunning

func (wno *WaitNotify) WaitForRunning(interval int64)

func (*WaitNotify) Wakeup

func (wno *WaitNotify) Wakeup(interval int64)

Jump to

Keyboard shortcuts

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