timer

package
v1.2.0-beta6-fix3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package timer 群管定时器

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTimer        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTimer          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTimer = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type Clock

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

func NewClock

func NewClock(pbfile string) (c Clock)

func (*Clock) CancelTimer

func (c *Clock) CancelTimer(key string) bool

CancelTimer 取消计时器

func (*Clock) GetTimer

func (c *Clock) GetTimer(key string) (t *Timer, ok bool)

func (*Clock) ListTimers

func (c *Clock) ListTimers(grpID uint64) []string

ListTimers 列出本群所有计时器

func (*Clock) RegisterTimer

func (c *Clock) RegisterTimer(ts *Timer, grp int64, save bool) bool

RegisterTimer 注册计时器

func (*Clock) SaveTimers

func (c *Clock) SaveTimers() error

SaveTimers 保存当前计时器

type Timer

type Timer struct {
	Alert                       string   `protobuf:"bytes,1,opt,name=alert,proto3" json:"alert,omitempty"`
	Cron                        string   `protobuf:"bytes,2,opt,name=cron,proto3" json:"cron,omitempty"`
	En1Month4Day5Week3Hour5Min6 int32    `protobuf:"varint,4,opt,name=en1month4day5week3hour5min6,proto3" json:"en1month4day5week3hour5min6,omitempty"`
	Selfid                      int64    `protobuf:"varint,8,opt,name=selfid,proto3" json:"selfid,omitempty"`
	Url                         string   `protobuf:"bytes,16,opt,name=url,proto3" json:"url,omitempty"`
	XXX_NoUnkeyedLiteral        struct{} `json:"-"`
	XXX_unrecognized            []byte   `json:"-"`
	XXX_sizecache               int32    `json:"-"`
}

func GetFilledCronTimer

func GetFilledCronTimer(croncmd string, alert string, img string, botqq int64) *Timer

GetFilledCronTimer 获得以cron填充好的ts

func GetFilledTimer

func GetFilledTimer(dateStrs []string, botqq int64, matchDateOnly bool) *Timer

GetFilledTimer 获得填充好的ts

func (*Timer) Day

func (m *Timer) Day() (d int)

func (*Timer) Descriptor added in v1.2.0

func (*Timer) Descriptor() ([]byte, []int)

func (*Timer) En

func (m *Timer) En() (en bool)

func (*Timer) GetAlert added in v1.2.0

func (m *Timer) GetAlert() string

func (*Timer) GetCron added in v1.2.0

func (m *Timer) GetCron() string

func (*Timer) GetEn1Month4Day5Week3Hour5Min6 added in v1.2.0

func (m *Timer) GetEn1Month4Day5Week3Hour5Min6() int32

func (*Timer) GetSelfid added in v1.2.0

func (m *Timer) GetSelfid() int64

func (*Timer) GetTimerInfo

func (ts *Timer) GetTimerInfo(grp int64) string

GetTimerInfo 获得标准化定时字符串

func (*Timer) GetUrl added in v1.2.0

func (m *Timer) GetUrl() string

func (*Timer) Hour

func (m *Timer) Hour() (h int)

func (*Timer) Marshal added in v1.2.0

func (m *Timer) Marshal() (dAtA []byte, err error)

func (*Timer) MarshalTo added in v1.2.0

func (m *Timer) MarshalTo(dAtA []byte) (int, error)

func (*Timer) MarshalToSizedBuffer added in v1.2.0

func (m *Timer) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Timer) Minute

func (m *Timer) Minute() (min int)

func (*Timer) Month

func (m *Timer) Month() (mon time.Month)

func (*Timer) ProtoMessage added in v1.2.0

func (*Timer) ProtoMessage()

func (*Timer) Reset added in v1.2.0

func (m *Timer) Reset()

func (*Timer) SetDay

func (m *Timer) SetDay(d int)

func (*Timer) SetEn

func (m *Timer) SetEn(en bool)

func (*Timer) SetHour

func (m *Timer) SetHour(h int)

func (*Timer) SetMinute

func (m *Timer) SetMinute(min int)

func (*Timer) SetMonth

func (m *Timer) SetMonth(mon time.Month)

func (*Timer) SetWeek

func (m *Timer) SetWeek(w time.Weekday)

func (*Timer) Size added in v1.2.0

func (m *Timer) Size() (n int)

func (*Timer) String added in v1.2.0

func (m *Timer) String() string

func (*Timer) Unmarshal added in v1.2.0

func (m *Timer) Unmarshal(dAtA []byte) error

func (*Timer) Week

func (m *Timer) Week() (w time.Weekday)

func (*Timer) XXX_DiscardUnknown added in v1.2.0

func (m *Timer) XXX_DiscardUnknown()

func (*Timer) XXX_Marshal added in v1.2.0

func (m *Timer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Timer) XXX_Merge added in v1.2.0

func (m *Timer) XXX_Merge(src proto.Message)

func (*Timer) XXX_Size added in v1.2.0

func (m *Timer) XXX_Size() int

func (*Timer) XXX_Unmarshal added in v1.2.0

func (m *Timer) XXX_Unmarshal(b []byte) error

type TimersMap

type TimersMap struct {
	Timers               map[string]*Timer `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*TimersMap) Descriptor added in v1.2.0

func (*TimersMap) Descriptor() ([]byte, []int)

func (*TimersMap) GetTimers added in v1.2.0

func (m *TimersMap) GetTimers() map[string]*Timer

func (*TimersMap) Marshal added in v1.2.0

func (m *TimersMap) Marshal() (dAtA []byte, err error)

func (*TimersMap) MarshalTo added in v1.2.0

func (m *TimersMap) MarshalTo(dAtA []byte) (int, error)

func (*TimersMap) MarshalToSizedBuffer added in v1.2.0

func (m *TimersMap) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TimersMap) ProtoMessage added in v1.2.0

func (*TimersMap) ProtoMessage()

func (*TimersMap) Reset added in v1.2.0

func (m *TimersMap) Reset()

func (*TimersMap) Size added in v1.2.0

func (m *TimersMap) Size() (n int)

func (*TimersMap) String added in v1.2.0

func (m *TimersMap) String() string

func (*TimersMap) Unmarshal added in v1.2.0

func (m *TimersMap) Unmarshal(dAtA []byte) error

func (*TimersMap) XXX_DiscardUnknown added in v1.2.0

func (m *TimersMap) XXX_DiscardUnknown()

func (*TimersMap) XXX_Marshal added in v1.2.0

func (m *TimersMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimersMap) XXX_Merge added in v1.2.0

func (m *TimersMap) XXX_Merge(src proto.Message)

func (*TimersMap) XXX_Size added in v1.2.0

func (m *TimersMap) XXX_Size() int

func (*TimersMap) XXX_Unmarshal added in v1.2.0

func (m *TimersMap) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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