discovery

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: 3 Imported by: 1

Documentation

Overview

Package discovery implements the TAXII 2.1 API Root resource.

The following information comes directly from the TAXII 2.1 specification.

This Endpoint provides general information about a TAXII Server, including the advertised API Roots. It's a common entry point for TAXII Clients into the data and services provided by a TAXII Server. For example, clients auto-discovering TAXII Servers via the DNS SRV record defined in section 1.6.1 will be able to automatically retrieve a discovery response for that server by requesting the /taxii2/ path on that domain.

Discovery API responses MAY advertise any TAXII API Root that they have permission to advertise, included those hosted on other servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

type Discovery struct {
	properties.TitleProperty
	properties.DescriptionProperty
	Contact  string   `json:"contact,omitempty"`
	Default  string   `json:"default,omitempty"`
	APIRoots []string `json:"api_roots,omitempty"`
}
Discovery - This type implements the TAXII 2 Discovery and defines all of the

properties and methods needed to create and work with this resource. All of the methods not defined local to this type are inherited from the individual properties.

The following information comes directly from the TAXII 2.1 specification.

The discovery resource contains information about a TAXII Server, such as a human-readable title, description, and contact information, as well as a list of API Roots that it is advertising. It also has an indication of which API Root it considers the default, or the one to use in the absence of another information/user choice.

func Decode

func Decode(data []byte) (*Discovery, error)
Decode - This function is a simple wrapper for decoding JSON data. It will

decode a slice of bytes into an actual struct and return a pointer to that object along with any errors.

func New

func New() *Discovery
New - This function will create a new TAXII Discovery resource and return

it as a pointer.

func (*Discovery) AddAPIRoots

func (o *Discovery) AddAPIRoots(values interface{}) error
AddAPIRoots - This method takes in a string value, a comma separated list of

string values, or a slice of string values that represents an API Root and adds it to the apiroots property.

func (*Discovery) Encode

func (o *Discovery) Encode() ([]byte, error)

Encode - This method is a simple wrapper for encoding an object into JSON

func (*Discovery) EncodeToString

func (o *Discovery) EncodeToString() (string, error)
EncodeToString - This method is a simple wrapper for encoding an object into

JSON

func (*Discovery) GetContact

func (o *Discovery) GetContact() string
GetContact - This method returns the contact information from the contact

property.

func (*Discovery) GetDefault

func (o *Discovery) GetDefault() string

GetDefault - This methods returns the default api-root.

func (*Discovery) SetContact

func (o *Discovery) SetContact(s string) error
SetContact - This methods takes in a string value representing contact

information and updates the contact property.

func (*Discovery) SetDefault

func (o *Discovery) SetDefault(s string) error
SetDefault - This methods takes in a string value representing a default

api-root and updates the default property.

Jump to

Keyboard shortcuts

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