huangli

package
v0.0.0-...-95c2fd8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Finalize

func Finalize()

Finalize close db

func Init

func Init(filename string) error

Init open db and create table

Types

type Festival

type Festival struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Rest        string `json:"rest"`

	Month int `json:"month"`

	Holidays HolidayList `json:"list"`
	// contains filtered or unexported fields
}

func (*Festival) DecodeHolidayList

func (info *Festival) DecodeHolidayList()

func (*Festival) EncodeHolidayList

func (info *Festival) EncodeHolidayList()

type FestivalList

type FestivalList []*Festival

func NewFestivalList

func NewFestivalList(year, month int) (FestivalList, error)

func (FestivalList) Create

func (list FestivalList) Create(year int) error

func (FestivalList) String

func (list FestivalList) String() string

type Holiday

type Holiday struct {
	Date   string        `json:"date"`
	Status HolidayStatus `json:"status"`
}

type HolidayList

type HolidayList []*Holiday

func (HolidayList) Contain

func (list HolidayList) Contain(year, month int) bool

type HolidayStatus

type HolidayStatus int
const (
	HolidayStatusLeave HolidayStatus = iota + 1
	HolidayStatusWork
)

type HuangLi

type HuangLi struct {
	ID    int64  `json:"id"` // format: ("%s%02s%02s", year, month, day)
	Avoid string `json:"avoid"`
	Suit  string `json:"suit"`
}

HuangLi huang li info from baidu

func NewHuangLi

func NewHuangLi(id int64) (*HuangLi, error)

NewHuangLi query by id

type HuangLiList

type HuangLiList []*HuangLi

HuangLiList huang li info list

func NewHuangLiList

func NewHuangLiList(idList []int64) (HuangLiList, error)

NewHuangLiList query by id list

func (HuangLiList) Create

func (list HuangLiList) Create() error

Create insert to sqlite, if exists, ignore

Jump to

Keyboard shortcuts

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