Documentation ¶
Index ¶
- Variables
- func FindMediaURLs(metadata persist.TokenMetadata, imgKeywords []string, animKeywords []string) (imgURL ImageURL, animURL AnimationURL, err error)
- func FindMediaURLsChain(metadata persist.TokenMetadata, chain persist.Chain) (imgURL ImageURL, animURL AnimationURL, err error)
- func FindMediaURLsKeys(metadata persist.TokenMetadata, imgKeywords []string, animKeywords []string) (imgKey string, imgURL ImageURL, animKey string, animURL AnimationURL, ...)
- func FindMediaURLsKeysChain(metadata persist.TokenMetadata, chain persist.Chain) (imgKey string, imgURL ImageURL, animKey string, animURL AnimationURL, ...)
- func MediaFromContentType(contentType string) persist.MediaType
- func PredictMediaType(ctx context.Context, url string) (persist.MediaType, string, *int64, error)
- func PredictMediaURLs(ctx context.Context, metadata persist.TokenMetadata, imgKeywords []string, ...) (imgURL ImageURL, animURL AnimationURL, err error)
- func RawFormatToMediaType(format string) persist.MediaType
- func SniffMediaType(buf []byte) (persist.MediaType, string)
- type AnimationURL
- type ImageURL
Constants ¶
This section is empty.
Variables ¶
var ErrNoMediaURLs = errors.New("no media URLs found in metadata")
Functions ¶
func FindMediaURLs ¶
func FindMediaURLs(metadata persist.TokenMetadata, imgKeywords []string, animKeywords []string) (imgURL ImageURL, animURL AnimationURL, err error)
FindMediaURLs finds the image and animation URLs from a token's metadata
func FindMediaURLsChain ¶
func FindMediaURLsChain(metadata persist.TokenMetadata, chain persist.Chain) (imgURL ImageURL, animURL AnimationURL, err error)
FindMediaURLsChain finds the image and animation URLs from a token's metadata, using the chain's base keywords
func FindMediaURLsKeys ¶
func FindMediaURLsKeys(metadata persist.TokenMetadata, imgKeywords []string, animKeywords []string) (imgKey string, imgURL ImageURL, animKey string, animURL AnimationURL, err error)
FindMediaURLsKeys finds the image and animation URLs and corresponding keywords from a token's metadata
func FindMediaURLsKeysChain ¶
func FindMediaURLsKeysChain(metadata persist.TokenMetadata, chain persist.Chain) (imgKey string, imgURL ImageURL, animKey string, animURL AnimationURL, err error)
FindMediaURLsKeysChain finds the image and animation URLs and corresponding keywords from a token's metadata, using the chain's base keywords
func MediaFromContentType ¶
MediaFromContentType will attempt to convert a content type to a media type
func PredictMediaType ¶
PredictMediaType guesses the media type of the given URL.
func PredictMediaURLs ¶
func PredictMediaURLs(ctx context.Context, metadata persist.TokenMetadata, imgKeywords []string, animKeywords []string) (imgURL ImageURL, animURL AnimationURL, err error)
PredictMediaURLs finds the image and animation URLs from a token's metadata and accesses them to predict the true URLs
func RawFormatToMediaType ¶
Types ¶
type AnimationURL ¶
type AnimationURL string