deckard

package module
v0.0.0-...-2d47bf9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

README

deckard

Stay awhile and listen!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identifier

type Identifier struct {
	// ID is the Identifier's unique ID.
	ID int `json:"id,omitempty"`

	// Name is the human-readable name of the Identifier. Uniqueness is
	// not a requirement.
	Name string `json:"name,omitempty"`

	// Description is a long-form description of the Identifier.
	Description string `json:"description,omitempty"`

	// Tags is a list of keys that are used for targetting a Identifier for
	// execution. When a request is made to execute a Identifier or set of
	// Identifiers, the Tags field is used as a filter for determining if a
	// Identifier should be executed.
	Tags map[string]struct{} `json:"tags"`

	// Endpoint is the full URL of the remote service to call this
	// Identifier.
	Endpoint string `json:"endpoint,omitempty"`

	// Schedule is a cron representation of when this Identifier should
	// be called. For additional information on format, see:
	// https://en.wikipedia.org/wiki/Cron#Overview
	Schedule string `json:"schedule,omitempty"`
}

func (*Identifier) HasTags

func (i *Identifier) HasTags(tagKeys ...string) bool

func (*Identifier) MarshalJSON

func (i *Identifier) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface so Identifier values can be converted into strings. Specifically, we want to:

  • Convert Endpoint values from Endpoint structs into strings.
  • Convert Tags values from string-slices to maps.

func (*Identifier) UnmarshalJSON

func (i *Identifier) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface so Identifier values can be unmarshaled as strings. Specifically, we want to:

  • Convert Endpoint values from strings into Endpoint structs.
  • Convert Tags values from maps to string-slices.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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