status

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status struct {
	properties.IDProperty
	Status           string          `json:"status,omitempty"`
	RequestTimestamp string          `json:"request_timestamp,omitempty"`
	TotalCount       int             `json:"total_count,omitempty"`
	SuccessCount     int             `json:"success_count,omitempty"`
	Successes        []StatusDetails `json:"successes,omitempty"`
	FailureCount     int             `json:"failure_count,omitempty"`
	Failures         []StatusDetails `json:"failures,omitempty"`
	PendingCount     int             `json:"pending_count,omitempty"`
	Pendings         []StatusDetails `json:"pendings,omitempty"`
}

Status - This type implements the TAXII 2 Status Resource and defines all of the properties and methods needed to create and work with the TAXII Status Resource.

The following information comes directly from the TAXII 2 specification documents.

The status resource represents information about a request to add objects to a Collection. It contains information about the status of the request, such as whether or not it's completed (status) and MAY contain the status of individual objects within the request (i.e. whether they are still pending, completed and failed, or completed and succeeded).

func New

func New() *Status

New - This function will create a new TAXII Status object and return it as a pointer.

func (*Status) AddFailureDetails

func (o *Status) AddFailureDetails(o *StatusDetails) (int, error)

AddFailureDetails - This method will take in a SuccessDetails type as a pointer and add it to the Failures property. One would use this if they manually created their own SuccessDetails type and then wanted to add it to the Failures property.

func (*Status) AddPendingDetails

func (o *Status) AddPendingDetails(o *StatusDetails) (int, error)

AddPendingDetails - This method will take in a SuccessDetails type as a pointer and add it to the Pendings property. One would use this if they manually created their own SuccessDetails type and then wanted to add it to the Pendings property.

func (*Status) AddSuccessDetails

func (o *Status) AddSuccessDetails(s *StatusDetails) (int, error)

AddSuccessDetails - This method will take in a SuccessDetails type as a pointer and add it to the Successes property. One would use this if they manually created their own SuccessDetails type and then wanted to add it to the Successes property.

func (*Status) CreateFailureDetails

func (o *Status) CreateFailureDetails(id, ver, mesg string) error

CreateFailureDetails - This method will create a FailureDetails type based on the data provided and will add it to the Failures property.

func (*Status) CreatePendingDetails

func (o *Status) CreatePendingDetails(id, ver, mesg string) error

CreatePendingDetails - This method will create a SuccessDetails type based on the data provided and will add it to the Pending property.

func (*Status) CreateSuccessDetails

func (o *Status) CreateSuccessDetails(id, ver, mesg string) error

CreateSuccessDetails - This method will create a SuccessDetails type based on the data provided and will add it to the Successes property.

func (*Status) IncreaseFailureCount

func (o *Status) IncreaseFailureCount() error

IncreaseFailureCount - Increase Failure count number.

func (*Status) IncreasePendingCount

func (o *Status) IncreasePendingCount() error

IncreasePendingCount - Increase Pending count number.

func (*Status) IncreaseSuccessCount

func (o *Status) IncreaseSuccessCount() error

IncreaseSuccessCount - Increase Success count number.

func (*Status) IncreaseTotalCount

func (o *Status) IncreaseTotalCount() error

IncreaseTotalCount - Increase Total count number.

func (*Status) NewFailureDetails

func (o *Status) NewFailureDetails() (*StatusDetails, error)

NewFailureDetails - This method will create an empty SuccessDetails type, add it to the Failures property, and return a pointer to that instance.

func (*Status) NewPendingDetails

func (o *Status) NewPendingDetails() (*StatusDetails, error)

NewPendingDetails - This method will create an empty SuccessDetails type, add it to the Pendings property, and return a pointer to that instance.

func (*Status) NewSuccessDetails

func (o *Status) NewSuccessDetails() (*StatusDetails, error)

NewSuccessDetails - This method will create an empty SuccessDetails type, add it to the Successes property, and return a pointer to that instance.

func (*Status) SetFailureCount

func (o *Status) SetFailureCount(i int) error

SetFailureCount - Set Failure Count to value provided.

func (*Status) SetPendingCount

func (o *Status) SetPendingCount(i int) error

SetPendingCount - Set Pending Count to value provided.

func (*Status) SetRequestTimestamp

func (o *Status) SetRequestTimestamp(s string) error

SetRequestTimestamp - This method will set the Request time stamp to the provided value.

func (*Status) SetRequestTimestampToCurrentTime

func (o *Status) SetRequestTimestampToCurrentTime() error

SetRequestTimestampToCurrentTime - This method will set the Request time stamp to the current time with micro second precision.

func (*Status) SetStatusCompleted

func (o *Status) SetStatusCompleted() error

SetStatusCompleted - This method will set the status to completed.

func (*Status) SetStatusPending

func (o *Status) SetStatusPending() error

SetStatusPending - This method will set the status to pending.

func (*Status) SetSuccessCount

func (o *Status) SetSuccessCount(i int) error

SetSuccessCount - Set Success Count to value provided.

func (*Status) SetTotalCount

func (o *Status) SetTotalCount(i int) error

SetTotalCount - Set Total Count to value provided.

type StatusDetails

type StatusDetails struct {
	ID      string `json:"id,omitempty"`
	Version string `json:"version,omitempty"`
	Message string `json:"message,omitempty"`
}

StatusDetails - This type defines the details for various status elements

func NewStatusDetails

func NewStatusDetails() *StatusDetails

NewStatusDetails - This function will create a new TAXII Status Detail object and return it as a pointer.

func (*StatusDetails) SetID

func (o *StatusDetails) SetID(s string) error

SetID - This method will set the ID to the provided value.

func (*StatusDetails) SetMessage

func (o *StatusDetails) SetMessage(s string) error

SetMessage - This method will set the Message to the provided value.

func (*StatusDetails) SetVersion

func (o *StatusDetails) SetVersion(s string) error

SetVersion - This method will set the Version to the provided value.

Jump to

Keyboard shortcuts

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