go_jsdelivr

package module
v0.0.0-...-47d48a4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 5 Imported by: 0

README

go-jsdelivr

try cover url to jsDelivr CDN url

代码引用

  • 引入包 go get github.com/Luoxin/go-jsdelivr
  • 示例代码
package main

import (
	go_jsdelivr "github.com/Luoxin/go-jsdelivr"
)

func main() {
	nu, err := go_jsdelivr.Cover("https://raw.githubusercontent.com/Luoxin/go-jsdelivr/master/README.md")
	if err != nil {
		fmt.Println(err)
	} else {
		// https://cdn.jsdelivr.net/gh/Luoxin/go-jsdelivr@master/README.md
		fmt.Println(nu)
	}
}

直接使用

源码使用
  • gh repo clone Luoxin/go-jsdelivr
  • cd go-jsdelivr
  • go mod downlaod
  • go run ./cmd/jsdelivr.go <url>
使用编译好的包

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotSupportedErr = errors.New("not support")

Functions

func Cover

func Cover(urlRaw string) (string, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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