incidents

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: MIT Imports: 2 Imported by: 0

README

incidents

import "github.com/brittonhayes/citadel/gen/incidents"

Index

Constants

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

const ServiceName = "incidents"

Variables

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

var MethodNames = [2]string{"find", "list all"}

func NewFindEndpoint

func NewFindEndpoint(s Service) endpoint.Endpoint

NewFindEndpoint returns an endpoint function that calls the method "find" of service "incidents".

func NewListAllEndpoint

func NewListAllEndpoint(s Service) endpoint.Endpoint

NewListAllEndpoint returns an endpoint function that calls the method "list all" of service "incidents".

type Client

Client is the "incidents" service client.

type Client struct {
    FindEndpoint    endpoint.Endpoint
    ListAllEndpoint endpoint.Endpoint
}
func NewClient
func NewClient(find, listAll endpoint.Endpoint) *Client

NewClient initializes a "incidents" service client given the endpoints.

func (*Client) Find
func (c *Client) Find(ctx context.Context, p *FindPayload) (res *Incident, err error)

Find calls the "find" endpoint of the "incidents" service. Find may return the following errors: - "no_match" (type NoMatch) - error: internal error

func (*Client) ListAll
func (c *Client) ListAll(ctx context.Context, p *LimitPayload) (res []*Incident, err error)

ListAll calls the "list all" endpoint of the "incidents" service. ListAll may return the following errors: - "no_match" (type NoMatch) - error: internal error

type Endpoints

Endpoints wraps the "incidents" service endpoints.

type Endpoints struct {
    Find    endpoint.Endpoint
    ListAll endpoint.Endpoint
}
func NewEndpoints
func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "incidents" service with endpoints.

func (*Endpoints) Use
func (e *Endpoints) Use(m func(endpoint.Endpoint) endpoint.Endpoint)

Use applies the given middleware to all the "incidents" service endpoints.

type FindPayload

FindPayload is the payload type of the incidents service find method.

type FindPayload struct {
    // Unique ID of the incident
    ID uint64
}

type Incident

Incident is the result type of the incidents service find method.

type Incident struct {
    // Unique ID of the incident
    ID  *uint64
    // Date the incident occurred
    Date *string
    // Date the incident occurred
    DateClosed *string
    // Permissions associated with incident
    Permissions *string
    // The severity of the incident
    Severity *int
    // The short title of the incident
    Title *string
    // The detailed description of the incident
    Summary *string
    // The scope of impact of this incident
    Scope *string
    // What group or individual caused the initial incident
    ResponsibleParty *string
    // A list of the affected customers
    AffectedCustomers []string
    // The original cause of the incident
    RootCause *string
    // The slack channel for incident discussions
    SlackChannel *string
    // When the incident was submitted
    CreatedAt *string
    // When the incident was last updated
    UpdatedAt *string
}

type LimitPayload

LimitPayload is the payload type of the incidents service list all method.

type LimitPayload struct {
    // Limit the number of results
    Limit *int32
}

type NoMatch

No incident matched given criteria

type NoMatch string
func (NoMatch) Error
func (e NoMatch) Error() string

Error returns an error description.

func (NoMatch) ErrorName
func (e NoMatch) ErrorName() string

ErrorName returns "no_match".

type Service

The incident service handles the creation and querying of security incidents

type Service interface {
    // Find implements find.
    Find(context.Context, *FindPayload) (res *Incident, err error)
    // ListAll implements list all.
    ListAll(context.Context, *LimitPayload) (res []*Incident, err error)
}

Generated by gomarkdoc

Documentation

Index

Constants

View Source
const ServiceName = "incidents"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"find", "list all"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewFindEndpoint

func NewFindEndpoint(s Service) endpoint.Endpoint

NewFindEndpoint returns an endpoint function that calls the method "find" of service "incidents".

func NewListAllEndpoint

func NewListAllEndpoint(s Service) endpoint.Endpoint

NewListAllEndpoint returns an endpoint function that calls the method "list all" of service "incidents".

Types

type Client

type Client struct {
	FindEndpoint    endpoint.Endpoint
	ListAllEndpoint endpoint.Endpoint
}

Client is the "incidents" service client.

func NewClient

func NewClient(find, listAll endpoint.Endpoint) *Client

NewClient initializes a "incidents" service client given the endpoints.

func (*Client) Find

func (c *Client) Find(ctx context.Context, p *FindPayload) (res *Incident, err error)

Find calls the "find" endpoint of the "incidents" service. Find may return the following errors:

  • "no_match" (type NoMatch)
  • error: internal error

func (*Client) ListAll

func (c *Client) ListAll(ctx context.Context, p *LimitPayload) (res []*Incident, err error)

ListAll calls the "list all" endpoint of the "incidents" service. ListAll may return the following errors:

  • "no_match" (type NoMatch)
  • error: internal error

type Endpoints

type Endpoints struct {
	Find    endpoint.Endpoint
	ListAll endpoint.Endpoint
}

Endpoints wraps the "incidents" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "incidents" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(endpoint.Endpoint) endpoint.Endpoint)

Use applies the given middleware to all the "incidents" service endpoints.

type FindPayload

type FindPayload struct {
	// Unique ID of the incident
	ID uint64
}

FindPayload is the payload type of the incidents service find method.

type Incident

type Incident struct {
	// Unique ID of the incident
	ID *uint64
	// Date the incident occurred
	Date *string
	// Date the incident occurred
	DateClosed *string
	// Permissions associated with incident
	Permissions *string
	// The severity of the incident
	Severity *int
	// The short title of the incident
	Title *string
	// The detailed description of the incident
	Summary *string
	// The scope of impact of this incident
	Scope *string
	// What group or individual caused the initial incident
	ResponsibleParty *string
	// A list of the affected customers
	AffectedCustomers []string
	// The original cause of the incident
	RootCause *string
	// The slack channel for incident discussions
	SlackChannel *string
	// When the incident was submitted
	CreatedAt *string
	// When the incident was last updated
	UpdatedAt *string
}

Incident is the result type of the incidents service find method.

type LimitPayload

type LimitPayload struct {
	// Limit the number of results
	Limit *int32
}

LimitPayload is the payload type of the incidents service list all method.

type NoMatch

type NoMatch string

No incident matched given criteria

func (NoMatch) Error

func (e NoMatch) Error() string

Error returns an error description.

func (NoMatch) ErrorName

func (e NoMatch) ErrorName() string

ErrorName returns "no_match".

type Service

type Service interface {
	// Find implements find.
	Find(context.Context, *FindPayload) (res *Incident, err error)
	// ListAll implements list all.
	ListAll(context.Context, *LimitPayload) (res []*Incident, err error)
}

The incident service handles the creation and querying of security incidents

Jump to

Keyboard shortcuts

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