go-frameproto/writeframe.go

29 lines
753 B
Go
Raw Normal View History

2024-02-14 02:56:08 +00:00
package frameproto
import (
"io"
)
// WriteFrame will write the HTML <meta/> element for the Frame-Protocol's (i.e., Farcaster Frame's) "fc:frame" name-value pair.
//
// For example, this call:
//
// var version string = "vNext"
//
2024-02-15 12:53:12 +00:00
// str := frameproto.WriteFrame(writer, version)
2024-02-14 02:56:08 +00:00
//
// Would write this HTML <meta/> element:
//
// <meta property="fc:frame" content="vNext" />
//
// Note that this package provides some constants to use with WriteFrame.
// Namely: VersionVNext (for "vNext").
//
// Which in code would be used as:
//
2024-02-15 12:53:12 +00:00
// str := frameproto.WriteFrame(writer, frameproto.VersionVNext)
2024-02-14 02:56:08 +00:00
func WriteFrame(writer io.Writer, version string) {
const property string = MetaPropertyFrame
writeMetaPropertyContent(writer, property, version)
}