xservice

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

功能:服务接口 说明:

功能:服务 说明:

功能:服务状态 说明:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IService

type IService interface {
	Service_start() error
	Service_status() Status
	Service_stop() error
}

type Service

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

Service 服务

func (*Service) Is_dead

func (s *Service) Is_dead() bool

Is_dead 是否关闭

func (*Service) Is_running

func (s *Service) Is_running() bool

Is_running 是否在运行

func (*Service) Service_status

func (s *Service) Service_status() Status

Service_status 状态

func (*Service) Update_status

func (s *Service) Update_status(st Status)

Update_status 更新状态

func (*Service) With_lock

func (s *Service) With_lock(handler func())

With_lock 锁

func (*Service) With_lock_error

func (s *Service) With_lock_error(handler func() error) error

With_lock_error 锁

func (*Service) With_lock_read

func (s *Service) With_lock_read(handler func())

With_lock_read 锁

func (*Service) With_lock_read_error

func (s *Service) With_lock_read_error(handler func() error) error

With_lock_read_error 锁

type Status

type Status int

服务状态

const (
	STATUS_NIL     Status = 0 //初始
	STATUS_RUNNING Status = 1 //运行中
	STATUS_DEAD    Status = 2 //关闭
)

func (Status) String

func (s Status) String() string

String 转字符串

Jump to

Keyboard shortcuts

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