xduanlianjie

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: BSD-3-Clause-Clear Imports: 2 Imported by: 0

Documentation

Overview

三方-短链接相关的SDK

官网地址:https://www.duanlianjie.net/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(c *UrlConfig) (string, error)

获取URL链接

c	网址配置

func GetUrl

func GetUrl(url string) (string, error)

获取URL链接

url	待转换的长网址

func GetUrlDate

func GetUrlDate(longurl, date string) (string, error)

获取URL链接

longurl	待转换的长网址
date	有效期截止日期

func Regedit

func Regedit(c *Config)

注入配置项

func SetKey

func SetKey(key string)

设置默认配置项中的key标识信息

key	设置的key标识

Types

type Config

type Config struct {
	Key       string // 短网址的授权KEY
	DomainUrl string // 生成的接口地址
}

type UrlConfig

type UrlConfig struct {
	Url      string    `json:"url"`      // 要生成的网址
	Password string    `json:"password"` // 访问密码
	Expiry   string    `json:"expiry"`   // 短网址有效期,日期格式
	Counts   *UrlLimit `json:"limit"`    // 访问次数限制
}

URL链接配置

type UrlLimit

type UrlLimit struct {
	Type  uint8 `json:"boundstype"` // 访问次数限制方式 0-按总访问量 1-按独立访客访问量
	Count uint  `json:"bounds"`     // 限制的访问次数
}

访问次数限制

Jump to

Keyboard shortcuts

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