Documentation ¶
Overview ¶
Package gz 干支计算 六十甲子 五行生克 十二长生 十干禄位 纳因 年月日时干支 咸池 华盖 黄黑 建除 日禽 月将 贵人 天三门 地四户 地私门 太冲天马 登天门 阴历 朔望
Index ¶
- Variables
- func AliasGan(jd float64) string
- func AliasHourGan()
- func AliasHourZhi()
- func AliasMonthGan()
- func AliasMonthZhi()
- func AliasStarName(wd int, aliasZhi string) string
- func AliasYearGan()
- func AliasYearZhi()
- func AliasZhi(jd float64) string
- func ChangSheng(gan, zhi string) string
- func ChangSheng4(gan string, localGn int) string
- func ChangSheng8(gan string, localGn int) string
- func ChangShengMonthS(gan, zhi string) string
- func ChangShengString(gan string) string
- func ChangShengZhi(gan, name string) (zhis string)
- func ChangShengZhiS(gan, zhi string) string
- func GanZhiChangSheng(xgz string) string
- func GetDayGZ(year, month, day int) string
- func GetHourGZ(dayGan string, hour int) string
- func GetJq24(year int) []time.Time
- func GetMonthGZ(year, month, day, hour int) string
- func GetNaYinString(gzx ...string) string
- func GetRiHuangHei(mgz, dgz string) string
- func GetRiJianChu(mgz, dgz string) string
- func GetRiQin(wd int, dgz string) string
- func GetWXSKS(gz string) string
- func GetYGZ(year, month, day int) string
- func GetYuanS(year int) string
- func GuiRen(dgz string) (yang, yin string)
- func HuangHei(gz, subgz string) string
- func IsGanShengGan(gana, ganb string) bool
- func IsGnShengGn(gna, gnb int) bool
- func JianChu(mgz, dgz string) string
- func Lu(gan string) string
- func NaYin(gzx string) string
- func TFixLiChun(lct, cust time.Time) bool
- func TMFixLiChun(lct, cust time.Time) bool
- func TMMonthGanZhi(year, month, day, hour, min int) (string, string, []time.Time, []string, []time.Time, []string)
- func TMYearGanZhi(year int, lcb bool) (string, string)
- func TMjieQi(year int) ([]time.Time, time.Time)
- func TMonthGanZhi(year, month, day, hour int) (string, string, []time.Time, []string, []time.Time, []string)
- func TYearGanZhi(year int, lcb bool) (string, string)
- func TianMen(yj, dgz string) (string, string)
- func TianSanMen(yueJiangZhi, hgz string) (string, string, string)
- func TjieQi(year int) ([]time.Time, time.Time)
- func WeekNumber(jd float64) int
- func WuXingGanVsGan(gan1, gan2 string) bool
- func WuXingShengKe(wx string) (string, string)
- func Wxsk(gz string) int
- func XunKong(xgz string) string
- func XunShou(xgz string) (string, []string)
- func YiMa(zhi string) string
- func ZhiGn(zhis string) int
- type DiSiHuStruct
- type DiSiMenStruct
- type Gan
- func (g Gan) ChangSheng(zhis string) string
- func (g Gan) ChangShengArray() ([]string, []string)
- func (g Gan) ChangShengHide(name string) string
- func (g Gan) ChangShengZhi(name string) string
- func (g Gan) GuiRen() (yang, yin string)
- func (g Gan) HuaHe(gan string) (bool, string)
- func (g Gan) IsWuXingSheng(ganb string) bool
- func (g Gan) JiGong() string
- func (g Gan) Lu() string
- func (g Gan) String() string
- func (g Gan) WuXing() string
- func (g Gan) WuXingShengKe() (string, string)
- func (g Gan) XiShen() int
- func (g Gan) YiXiang() string
- func (g Gan) YinYang() int
- type GanZhi
- func (obj *GanZhi) DiSiHu() *DiSiHuStruct
- func (obj *GanZhi) DiSiHuZhi() (string, string, string, string)
- func (obj *GanZhi) FuTou(dgz string) string
- func (obj *GanZhi) GetLunar() (string, string)
- func (obj *GanZhi) GetNaYinString() string
- func (obj *GanZhi) GuiRen(xgz string) (string, string)
- func (obj *GanZhi) Info() *Info
- func (obj *GanZhi) JianChu() string
- func (obj *GanZhi) JianChuDay() string
- func (obj *GanZhi) JieQi() string
- func (obj *GanZhi) Jq24() []string
- func (obj *GanZhi) Jq24T() []time.Time
- func (obj *GanZhi) Moons() *ShuoWang
- func (obj *GanZhi) NaYin(gzx string) string
- func (obj *GanZhi) NewGan(gan string) Gan
- func (obj *GanZhi) NewZhi(zhi string) Zhi
- func (obj *GanZhi) RiHuangHei1() string
- func (obj *GanZhi) RiQin(weekN int) string
- func (obj *GanZhi) ShiHuangHei1() string
- func (obj *GanZhi) TMJieQi() string
- func (obj *GanZhi) XunShou(xgz string) (string, []string)
- func (obj *GanZhi) YueJiang() (string, string, time.Time, string)
- func (obj GanZhi) YueJiangStruct() *YJ
- type Info
- type ShuoWang
- type TGan
- type TZhi
- type TianSanMenStruct
- type Zhi
- func (z Zhi) CangGan() struct{ ... }
- func (z Zhi) Chong() string
- func (z Zhi) ChongHide() string
- func (z Zhi) Hai() string
- func (z Zhi) HaiHide() string
- func (z Zhi) He() string
- func (z Zhi) HeHide() string
- func (z Zhi) HuaGai() string
- func (z Zhi) HuaHe(zhi string) (bool, string)
- func (z Zhi) Po() string
- func (z Zhi) PoHide() string
- func (z Zhi) WuXing() string
- func (z Zhi) WuXingShengKe() (string, string)
- func (z Zhi) XianChi() string
- func (z Zhi) Xing() string
- func (z Zhi) XingHide() string
- func (z Zhi) YiMa() string
Constants ¶
This section is empty.
Variables ¶
var ( Gans = []string{"err", "甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"} Zhis = []string{"err", "子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"} Jmc = []string{ "冬至", "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", } JiaZiArr = []string{ "甲子", "乙丑", "丙寅", "丁卯", "戊辰", "己巳", "庚午", "辛未", "壬申", "癸酉", "甲戌", "乙亥", "丙子", "丁丑", "戊寅", "己卯", "庚辰", "辛巳", "壬午", "癸未", "甲申", "乙酉", "丙戌", "丁亥", "戊子", "己丑", "庚寅", "辛卯", "壬辰", "癸巳", "甲午", "乙未", "丙申", "丁酉", "戊戌", "己亥", "庚子", "辛丑", "壬寅", "癸卯", "甲辰", "乙巳", "丙午", "丁未", "戊申", "己酉", "庚戌", "辛亥", "壬子", "癸丑", "甲寅", "乙卯", "丙辰", "丁巳", "戊午", "己未", "庚申", "辛酉", "壬戌", "癸亥"} )
var (
GuiRenMap = map[string]struct{ Yang, Yin string }{
"甲": {Yang: "未", Yin: "丑"},
"乙": {Yang: "申", Yin: "子"},
"丙": {Yang: "酉", Yin: "亥"},
"丁": {Yang: "亥", Yin: "酉"},
"戊": {Yang: "丑", Yin: "未"},
"己": {Yang: "子", Yin: "申"},
"庚": {Yang: "丑", Yin: "未"},
"辛": {Yang: "寅", Yin: "午"},
"壬": {Yang: "卯", Yin: "巳"},
"癸": {Yang: "巳", Yin: "卯"},
}
)
var ShengKeMap = map[string]string{"木": "土", "火": "金", "土": "水", "金": "木", "水": "火"}
ShengKeMap k 克 v
var StarName = []string{
"角木蛟", "亢金龙", "氐土貉", "房日兔", "心月狐", "尾火虎", "箕水豹",
"斗木獬", "牛金牛", "女土蝠", "虚日鼠", "危月燕", "室火猪", "壁水貐",
"奎木狼", "娄金狗", "胃土雉", "昴日鸡", "毕月乌", "觜火猴", "参水猿",
"井木犴", "鬼金羊", "柳土獐", "星日马", "张月鹿", "翼火蛇", "轸水蚓",
}
Functions ¶
func AliasHourGan ¶ added in v1.0.9
func AliasHourGan()
func AliasHourZhi ¶ added in v1.0.9
func AliasHourZhi()
func AliasMonthGan ¶ added in v1.0.9
func AliasMonthGan()
func AliasMonthZhi ¶ added in v1.0.9
func AliasMonthZhi()
func AliasStarName ¶ added in v1.0.8
AliasStarName 日禽 传入周数字 日支
func AliasYearGan ¶ added in v1.0.9
func AliasYearGan()
func AliasYearZhi ¶ added in v1.0.9
func AliasYearZhi()
func ChangSheng4 ¶ added in v1.1.0
ChangSheng4 四维宫的十干长生 传入干 本宫数字( 艮8 巽4 坤2 乾6)
func ChangSheng8 ¶ added in v1.1.0
ChangSheng8 八宫的十干长生 传入干 本宫数字(坎1 艮8 震3....)
func ChangShengMonthS ¶ added in v1.1.0
ChangShengMonthS 干在月支的长生状态
func ChangShengString ¶ added in v1.1.0
ChangShengString 十干长生String 如 传入天干甲 返回
func ChangShengZhi ¶ added in v1.1.0
ChangShengZhi 干在十二长生位置对应的地支 传入天干 十二长生名称(长生 沐浴 冠带 临官 帝旺 衰 病 死 墓 绝 胎 养) 返回对应的地支
func ChangShengZhiS ¶ added in v1.1.0
ChangShengZhiS 干 支 返回干在支的长生状态
func GanZhiChangSheng ¶ added in v1.0.8
GanZhiChangSheng 干支长生 返回干与支在十二长生的关系 比如甲子 甲在子位沐浴 则甲临沐浴
func GetMonthGZ ¶
GetMonthGZ 月干支 以12节气定月干支 传入阳历时间 返回月干支
func GetNaYinString ¶ added in v1.0.8
GetNaYinString 年月日时 的干支纳音
func IsGanShengGan ¶ added in v1.1.6
IsGanShengGan 判断干五行相生 传入干的五行属性 对比干的五行属性 如 天干甲五行属木 对比天干丙五行属火 判断甲是否生丙
func TFixLiChun ¶ added in v1.0.9
func TMFixLiChun ¶ added in v1.1.0
func TMMonthGanZhi ¶ added in v1.1.0
func TMMonthGanZhi(year, month, day, hour, min int) (string, string, []time.Time, []string, []time.Time, []string)
TMMonthGanZhi 返回 年干支 月干支 节气时间 节气名称 中气时间 中气名称
func TMYearGanZhi ¶ added in v1.1.0
TMYearGanZhi 年干 年支
func TMonthGanZhi ¶ added in v1.0.9
func TYearGanZhi ¶ added in v1.0.9
TYearGanZhi 年干 年支
func TianSanMen ¶ added in v1.1.4
TianSanMen 天三门
func WeekNumber ¶ added in v1.0.8
WeekNumber 星期数(7是周日) 这里传入的JD是时间精确到日计算
func WuXingGanVsGan ¶ added in v1.1.0
WuXingGanVsGan 天干五行生克 true 后者克前者
func WuXingShengKe ¶ added in v1.0.8
WuXingShengKe 五行生克 例:木生火 木克土 传入木 返回 火,土
Types ¶
type DiSiHuStruct ¶ added in v1.1.1
type DiSiHuStruct struct { ChuZhi string `json:"chu_zhi"` // 除 DingZhi string `json:"ding_zhi"` // 定 WeiZhi string `json:"wei_zhi"` // 危 KaiZhi string `json:"kai_zhi"` // 开 }
DiSiHuStruct 地四户
func (*DiSiHuStruct) Chu ¶ added in v1.1.1
func (d *DiSiHuStruct) Chu() (string, string)
func (*DiSiHuStruct) DiSiHuMap ¶ added in v1.1.4
func (d *DiSiHuStruct) DiSiHuMap() map[string]string
DiSiHuMap Map 地四户Map k:地支 v:除/定/危/开
func (*DiSiHuStruct) DiSiHuString ¶ added in v1.1.4
func (d *DiSiHuStruct) DiSiHuString() string
DiSiHuString 地四户String
func (*DiSiHuStruct) Ding ¶ added in v1.1.1
func (d *DiSiHuStruct) Ding() (string, string)
func (*DiSiHuStruct) Kai ¶ added in v1.1.1
func (d *DiSiHuStruct) Kai() (string, string)
func (*DiSiHuStruct) Wei ¶ added in v1.1.1
func (d *DiSiHuStruct) Wei() (string, string)
type DiSiMenStruct ¶ added in v1.1.1
type DiSiMenStruct struct { LiuHeZhi string `json:"liu_he"` TaiYinZhi string `json:"tai_yin"` TaiChangZhi string `json:"tai_chang"` }
DiSiMenStruct 地私门
func DiSiMen ¶ added in v1.1.1
func DiSiMen(yueJiang string, dgz, hgz string) *DiSiMenStruct
DiSiMen 地私门 传入月将 日干支 时干支 以日支 定本日使用的贵人 自子至巳为阳用阳贵神 自午至亥为阴用阴贵神 审太阳过宫,以月将加用时,寻本日贵人起星,求地私门。 月将加时辰 寻日干阳贵和阴贵下临的时辰地支 以该支定顺逆 亥至辰为阳贵顺行 巳至戌为阴贵逆行
func (*DiSiMenStruct) DiSiMenString ¶ added in v1.1.1
func (dsm *DiSiMenStruct) DiSiMenString() string
DiSiMenString DiSiMen 地私门结果 六合:卯 太阴:申 太常:酉
func (*DiSiMenStruct) LiuHe ¶ added in v1.1.1
func (dsm *DiSiMenStruct) LiuHe() (string, string)
LiuHe 地私门六合 六合对应的地支
func (*DiSiMenStruct) TaiChang ¶ added in v1.1.1
func (dsm *DiSiMenStruct) TaiChang() (string, string)
TaiChang 地私门太常 太常对应的地支
func (*DiSiMenStruct) TaiYin ¶ added in v1.1.1
func (dsm *DiSiMenStruct) TaiYin() (string, string)
TaiYin 地私门太阴 太阴对应的地支
type Gan ¶
type Gan string
Gan 天干
func (Gan) ChangSheng ¶ added in v1.0.9
ChangSheng 干在支的十二长生名称
func (Gan) ChangShengArray ¶ added in v1.1.0
ChangShengArray 十二长生数组 长生名称数组(0:长生 1:沐浴 2冠带 3临官 4帝旺 5衰 6病 7死 8墓 9绝 10胎 11:养)
func (Gan) ChangShengHide ¶ added in v1.0.9
ChangShengHide 十二长生
func (Gan) ChangShengZhi ¶ added in v1.1.0
ChangShengZhi 干在十二长生位置对应的地支 传入天干 十二长生名称(长生 沐浴 冠带 临官 帝旺 衰 病 死 墓 绝 胎 养) 返回对应的地支
func (Gan) IsWuXingSheng ¶ added in v1.1.6
IsWuXingSheng 干五行相生
func (Gan) WuXingShengKe ¶ added in v1.0.9
WuXingShengKe 五行生克 如天干甲生火 克土 这里返回 火 土
type GanZhi ¶
type GanZhi struct { Ygz string `json:"ygz"` Mgz string `json:"mgz"` Dgz string `json:"dgz"` Hgz string `json:"hgz"` JieQiArrT []time.Time `json:"jie_qi_arr_t"` //节气 len=14 [小寒 立春 惊蛰 清明 立夏 芒种 小暑 立秋 白露 寒露 立冬 大雪 小寒 立春] JieQiNames []string `json:"jie_qi_names"` ZhongQiArrT []time.Time `json:"zhong_qi_arr_t"` //中气 len=14 [冬至 大寒 雨水 春分 谷雨 小满 夏至 大暑 处暑 秋分 霜降 小雪 冬至 大寒] ZhongQiNames []string `json:"zhong_qi_names"` // contains filtered or unexported fields }
GanZhi 干支信息
func NewTGanZhi ¶ added in v1.0.9
NewTGanZhi 月干支精确到时辰
func NewTMGanZhi ¶ added in v1.1.0
NewTMGanZhi 干支精确到分钟
func (*GanZhi) DiSiHu ¶ added in v1.0.8
func (obj *GanZhi) DiSiHu() *DiSiHuStruct
DiSiHu 地四户(除 定 危 开)
func (*GanZhi) DiSiHuZhi ¶ added in v1.1.1
DiSiHuZhi DiSiHu 地四户 危 除 定 开 对应的地支 月建加时支上 危除定开下临方既是 建除满平一顺流,定执破危相接去,成收开闭掌中周,除定危开为四户,此方有难来逃避
func (*GanZhi) GetNaYinString ¶ added in v1.0.8
GetNaYinString 纳因(年-月-日-时)
func (*GanZhi) JianChuDay ¶ added in v1.0.8
JianChuDay 日建除另一个算法
func (*GanZhi) RiHuangHei1 ¶ added in v0.6.0
RiHuangHei1 日黄黑
func (*GanZhi) ShiHuangHei1 ¶ added in v0.6.0
ShiHuangHei1 时黄黑
func (GanZhi) YueJiangStruct ¶ added in v1.0.8
func (obj GanZhi) YueJiangStruct() *YJ
YueJiangStruct 月将
type Info ¶ added in v1.1.6
type Info struct { T time.Time `json:"t"` Ygz string `json:"ygz"` Mgz string `json:"mgz"` Dgz string `json:"dgz"` Hgz string `json:"hgz"` Moon string `json:"moon"` Solar string `json:"solar"` Lu [4]string `json:"lu"` //禄位 Array Gzs string `json:"gzs"` //干支 String XunKong [4]string `json:"xun_kong"` //旬空 Array NaYin string `json:"na_yin"` ZhongQi string `json:"zhong_qi"` YueJiang string `json:"yue_jiang"` JianChu string `json:"jian_chu"` RiQin string `json:"ri_qin"` HuangHei string `json:"huang_hei"` HuangHeiH string `json:"huang_hei_h"` JueLiRi string `json:"jue_li_ri"` JiTanBing string `json:"ji_tan_bing"` }
Info 基础信息(阴历,阳历,日建除,日禽,月将,日黄黑,时黄黑,旬空,纳音,绝离日,忌探病日)
type ShuoWang ¶ added in v1.1.4
type ShuoWang struct { LastWang time.Time `json:"last_wang"` NextWang time.Time `json:"next_wang"` Shuo time.Time `json:"shuo"` Wang time.Time `json:"wang"` ShangXian time.Time `json:"shang_xian"` XiaXian time.Time `json:"xia_xian"` LastShuo time.Time `json:"last_shuo"` NextShuo time.Time `json:"next_shuo"` }
type TianSanMenStruct ¶ added in v1.1.4
type TianSanMenStruct struct { TaiCongZhi string `json:"tai_cong_zhi"` CongKuiZhi string `json:"cong_kui_zhi"` XiaoJiZhi string `json:"xiao_ji_zhi"` }
TianSanMenStruct 天三门
func (*TianSanMenStruct) CongKui ¶ added in v1.1.4
func (tsm *TianSanMenStruct) CongKui() (string, string)
func (*TianSanMenStruct) TaiChong ¶ added in v1.1.4
func (tsm *TianSanMenStruct) TaiChong() (string, string)
func (*TianSanMenStruct) TianSanMenString ¶ added in v1.1.4
func (tsm *TianSanMenStruct) TianSanMenString() string
func (*TianSanMenStruct) XiaoJi ¶ added in v1.1.4
func (tsm *TianSanMenStruct) XiaoJi() (string, string)
type Zhi ¶
type Zhi string
Zhi 地支
func (Zhi) HuaGai ¶ added in v1.0.9
HuaGai 华盖
寅午戌人在戌 巳酉丑人在丑 申子辰人在辰 亥卯未人在未 凡命值一位者,近贵,多主僧道,术人,印禄同宫,三位俱定,食禄高强之人,三者全于年月日时者,乃妙。(林开五命) 华盖者,以三合之位入墓也,谓如寅午戌属火,戌为墓也,主人多能博识,立性聪明, 又云:华盖即墓杀也,所占颇异者,盖取三命旺相休囚凶神吉神多少,或身克杀,杀克身之类消息断之。(三命论) 华盖为庇荫之清神,主人旷颖神清,性灵恬淡,不较是非,好仙道伎巧事,一生不利财物, 惟与夹贵正印并,则为福清贵,特达,不利权握,日犯克妻,时犯克子,孤介之神也。(烛神经) 华盖要皆主福,若与岁干库同位为两重福,主大贵,三命提要华盖要见库墓冠带之乡, 假令癸卯金人,华盖在未,见丁未为冠带之位,若辛卯木人见之,为库墓之位,见癸未是木人之正印,最为贵格,余皆仿此。(珞琭贵贱格)
func (Zhi) WuXingShengKe ¶ added in v1.0.9
WuXingShengKe 五行生克
func (Zhi) XianChi ¶ added in v1.0.9
XianChi 咸池
《淮南子》曰:“日出扶桑,入于咸池。”故五行沐浴之地,名咸池。是取日人之义,万物暗昧之时。 寅午戌卯、已酉丑午、申子辰酉、亥卯未子即长生第二位沐浴之宫是也。 一名败神,一名桃花煞,其神之奸邪淫鄙,如生旺则美容仪,耽酒色,疏财好欢,破散家业,唯务贪淫; 如死绝,落魄不检,言行狡诈,游荡赌博,忘恩失信,私滥奸淫,靡所不为; 与元辰并,更临生旺者,多得匪人为妻;与贵人建禄并,多因油盐酒货得生,或因妇人暗昧之财起家,平生有水厄、痨瘵之疾,累遭遗失暗昧之灾。 此人入命,有破无成,非为吉兆,妇人尤忌之。 咸池非吉煞,日时与水命遇之尤凶。