mailschema

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 2 Imported by: 0

README

MailSchema for Go

Go Reference CI

The Mail Action Protocol 0.2 core artifacts and the MailSchema Registry contribution schema, embedded in Go.

Specification · Registry · Tools · Source

Install

go get github.com/mailschema/go@v0.2.0

Use an artifact

schema, err := mailschema.Schema(mailschema.MAPSchema)
if err != nil {
	panic(err)
}

MAPSchema, MAPContext, ContractFormatSchema and FormsSchema return independent copies of the files the profile record binds by SHA-256, byte for byte. ContributionSchema describes Registry contributions. Use the schemas with a Draft 2020-12 validator. Type contracts are not bundled: a client obtains them from the Registry catalogue by digest. Processing MAP messages is outside this module; see the profile.

Trust boundary

A valid document is structured input. Schema validation does not authenticate a service, grant authority or establish product conformance. The module performs no network requests. Module versions and MAP profile versions advance independently. MIT licensed.

Documentation

Overview

Package mailschema carries the Mail Action Protocol 0.2 core artifacts and the MailSchema Registry contribution schema, byte for byte as mailschema.org publishes them.

Type contracts are not bundled: a client obtains them from the Registry catalogue by digest. Processing MAP messages is outside this module.

Index

Constants

View Source
const Profile = "https://mailschema.org/profiles/map/0.2"

Profile is the MAP profile whose core artifacts this module carries.

Variables

This section is empty.

Functions

func Schema

func Schema(name SchemaName) ([]byte, error)

Schema returns an independent copy of a bundled artifact's exact bytes.

Types

type SchemaName

type SchemaName string

SchemaName identifies an artifact bundled with this module.

const (
	// MAPSchema is the MAP 0.2 core schema: descriptions, requests, results and problems.
	MAPSchema SchemaName = "map-0.2"
	// MAPContext is the MAP 0.2 JSON-LD context.
	MAPContext SchemaName = "map-0.2-context"
	// ContractFormatSchema is the type contract format every MAP 0.2 contract follows.
	ContractFormatSchema SchemaName = "type-contract-0.2"
	// FormsSchema is the form fields block contracts pin.
	FormsSchema SchemaName = "forms-0.1"
	// ContributionSchema describes Registry contributions and expanded type records.
	ContributionSchema SchemaName = "contribution"
)

Jump to

Keyboard shortcuts

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