network

package
v0.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GIT = "https://github.com/"
	API = "https://api.github.com/repos/"
)

Functions

func MakeUrl

func MakeUrl(OID string)

构建网址

func MatchReplies

func MatchReplies(uid, pwd string) (bool, error)

检查回复

func ReplaceData

func ReplaceData(text string, post *data.Post) string

替换通配符

func Webhook

func Webhook(p *data.Post)

回调博文

Types

type ApiData

type ApiData struct {
	Code int       `json:"code"`
	Data []Replies `json:"data"`
}

type Github

type Github struct {
	Username   string
	Repository string
	Branche    string
	Commit     struct {
		Sha string `json:"sha"`
	} `json:"commit"`
}

func (Github) Check

func (g Github) Check() bool

检查版本是否正确

func (*Github) GetLastCommit

func (g *Github) GetLastCommit() error

获取最新版本

func (Github) NoVersion

func (g Github) NoVersion() bool

判断版本文件是否存在

func (Github) ToAPI

func (g Github) ToAPI() string

仓库对应 api

func (Github) ToData

func (g Github) ToData() []byte

最后一次提交记录

func (Github) ToGIT

func (g Github) ToGIT() string

转 git

func (Github) Version

func (g Github) Version() string

版本文件路径

func (Github) Write

func (g Github) Write() bool

写入版本

type Replies

type Replies struct {
	Member struct {
		Mid   string `json:"mid"`
		Uname string `json:"uname"`
	} `json:"member"`
	Content struct {
		Message string `json:"message"`
	} `json:"content"`
}

func GetReplies

func GetReplies() ([]Replies, error)

返回最近回复

Jump to

Keyboard shortcuts

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