uni_links

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MIT Imports: 3 Imported by: 0

README

苹果通用链接库

定义association文件内容的结构体对象.

提供快速启动http server的快捷方法, 允许通过区分域名的方式同时服务多个应用的通用连接.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppLinks struct {
	Details []Detail `json:"details"`
}

AppLinks applinks字段 Apps应该始终为空数组 see https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/enabling_universal_links#3002229 > apps: > This key is not used for universal links, but it must be present and set to an empty array, as shown in Listing 1.

type AppLinksIOS12

type AppLinksIOS12 struct {
	Apps    []string      `json:"apps"`
	Details []DetailIOS12 `json:"details"`
}

AppLinksIOS12 applinks字段 Apps应该始终为空数组 see https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/enabling_universal_links#3002229 > apps: > This key is not used for universal links, but it must be present and set to an empty array, as shown in Listing 1.

type Association

type Association struct {
	AppLinks       AppLinks        `json:"applinks"`
	WebCredentials *WebCredentials `json:"webcredentials,omitempty"`
}

AssociationIOS12 iOS 12及以下版本的通用连接关联配置 reference: https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/enabling_universal_links#3381438

func (Association) Marshal

func (a Association) Marshal() (string, error)

type AssociationIOS12

type AssociationIOS12 struct {
	AppLinks       AppLinksIOS12   `json:"applinks"`
	WebCredentials *WebCredentials `json:"webcredentials,omitempty"`
}

AssociationIOS12 iOS 12及以下版本的通用连接关联配置 reference: https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/enabling_universal_links#3381438

func (AssociationIOS12) Marshal

func (a AssociationIOS12) Marshal() (string, error)

type AssociationMarshaler

type AssociationMarshaler interface {
	Marshal() (string, error)
}

type Component

type Component struct {
	Path     string            `json:"/,omitempty"`
	Query    map[string]string `json:"?,omitempty"`
	Fragment string            `json:"#,omitempty"`
	Exclude  bool              `json:"exclude,omitempty"`
	Comment  string            `json:"comment,omitempty"`
}

type Detail

type Detail struct {
	AppIDs     []string    `json:"appIDs"`
	Components []Component `json:"components"`
}

Detail detail信息

type DetailIOS12

type DetailIOS12 struct {
	AppID string   `json:"appID"`
	Paths []string `json:"paths"`
}

DetailIOS12 detail信息

type Domain

type Domain string

type HTTPServer

type HTTPServer struct {
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(addr string, afterResponse func(r *http.Request)) *HTTPServer

func (*HTTPServer) AddAssociation

func (s *HTTPServer) AddAssociation(d Domain, a AssociationMarshaler) error

func (*HTTPServer) Serve

func (s *HTTPServer) Serve() error

func (*HTTPServer) ServeHTTP

func (s *HTTPServer) ServeHTTP(resp http.ResponseWriter, req *http.Request)

type WebCredentials

type WebCredentials struct {
	Apps []string `json:"apps"`
}

Jump to

Keyboard shortcuts

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