docs

package
v0.0.0-...-ca24b28 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Structure = []Resource{
	{
		Name:        "Info",
		Description: "EVAN WILL EDIT THIS",
		Endpoints: []Endpoint{
			{
				Key:         "info-get",
				Description: "Retrieve information about the API",
			},
		},
	},
	{
		Name:        "Senders",
		Description: "EVAN WILL EDIT THIS",
		Endpoints: []Endpoint{
			{
				Key:         "sender-create",
				Description: "Create a new sender",
			},
			{
				Key:         "sender-list",
				Description: "List all senders",
			},
			{
				Key:         "sender-get",
				Description: "Retrieve a sender",
			},
			{
				Key:         "sender-update",
				Description: "Update a sender",
			},
			{
				Key:         "sender-delete",
				Description: "Delete a sender",
			},
		},
	},
	{
		Name:        "Templates",
		Description: "EVAN WILL EDIT THIS",
		Endpoints: []Endpoint{
			{
				Key:         "template-create",
				Description: "Create a new template",
			},
			{
				Key:         "template-list",
				Description: "Retrieve a list of templates",
			},
			{
				Key:         "template-get",
				Description: "Retrieve a template",
			},
			{
				Key:         "template-update",
				Description: "Update a template",
			},
			{
				Key:         "template-delete",
				Description: "Delete a template",
			},
		},
	},
	{
		Name:        "Campaign Types",
		Description: "EVAN WILL EDIT THIS",
		Endpoints: []Endpoint{
			{
				Key:         "campaign-type-create",
				Description: "Create a new campaign type",
			},
			{
				Key:         "campaign-type-list",
				Description: "Retrieve a list of campaign types",
			},
			{
				Key:         "campaign-type-get",
				Description: "Retrieve a campaign type",
			},
			{
				Key:         "campaign-type-update",
				Description: "Update a campaign type",
			},
			{
				Key:         "campaign-type-delete",
				Description: "Delete a campaign type",
			},
		},
	},
	{
		Name:        "Campaigns",
		Description: "Campaigns are an email to a set of users using a template provided directly or via a campaign type or via the default template.",
		Endpoints: []Endpoint{
			{
				Key:         "campaign-create",
				Description: "Create a new campaign",
			},
			{
				Key:         "campaign-get",
				Description: "Retrieve a campaign",
			},
			{
				Key:         "campaign-status",
				Description: "Retrieve the status of a campaign",
			},
		},
	},
	{
		Name:        "Unsubscribing",
		Description: "EVAN WILL EDIT THIS",
		Endpoints: []Endpoint{
			{
				Key:         "unsubscriber-put-client",
				Description: "Unsubscribe a user (with a client token)",
			},
			{
				Key:         "unsubscriber-put-user",
				Description: "Unsubscribe a user (with a user token)",
			},
			{
				Key:         "unsubscriber-delete-client",
				Description: "Resubscribe a user (with a client token)",
			},
			{
				Key:         "unsubscriber-delete-user",
				Description: "Resubscribe a user (with a user token)",
			},
		},
	},
}

Structure defines the top-level structure of the documentation to be generated.

Functions

func Diff

func Diff(left, right string) bool

func GenerateMarkdown

func GenerateMarkdown(context TemplateContext) (string, error)

Types

type Endpoint

type Endpoint struct {
	Key         string
	Description string
}

type Resource

type Resource struct {
	Name        string
	Description string
	Endpoints   []Endpoint
}

type RoundTrip

type RoundTrip struct {
	Request  *http.Request
	Response *http.Response
}

func (RoundTrip) Method

func (r RoundTrip) Method() string

func (RoundTrip) Path

func (r RoundTrip) Path() string

func (RoundTrip) RequestBody

func (r RoundTrip) RequestBody() string

func (RoundTrip) RequestHeaders

func (r RoundTrip) RequestHeaders() []string

func (RoundTrip) RequiredScopes

func (r RoundTrip) RequiredScopes() string

func (RoundTrip) ResponseBody

func (r RoundTrip) ResponseBody() string

func (RoundTrip) ResponseHeaders

func (r RoundTrip) ResponseHeaders() []string

func (RoundTrip) ResponseStatus

func (r RoundTrip) ResponseStatus() string

type RoundTripRecorder

type RoundTripRecorder struct {
	RoundTrips map[string]RoundTrip
}

func NewRoundTripRecorder

func NewRoundTripRecorder() *RoundTripRecorder

func (*RoundTripRecorder) Record

func (r *RoundTripRecorder) Record(key string, request *http.Request, response *http.Response) error

type TemplateContext

type TemplateContext struct {
	Resources []TemplateResource
}

func BuildTemplateContext

func BuildTemplateContext(resources []Resource, roundtrips map[string]RoundTrip) (TemplateContext, error)

type TemplateEndpoint

type TemplateEndpoint struct {
	Key             string
	Description     string
	Method          string
	Path            string
	RequiredScopes  string
	RequestHeaders  []string
	RequestBody     string
	ResponseStatus  string
	ResponseHeaders []string
	ResponseBody    string
}

type TemplateResource

type TemplateResource struct {
	Name        string
	Description string
	Endpoints   []TemplateEndpoint
}

Jump to

Keyboard shortcuts

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