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 ¶
- type Discovery
- func (o *Discovery) AddAPIRoots(values interface{}) error
- func (o *Discovery) Encode() ([]byte, error)
- func (o *Discovery) EncodeToString() (string, error)
- func (o *Discovery) GetContact() string
- func (o *Discovery) GetDefault() string
- func (o *Discovery) SetContact(s string) error
- func (o *Discovery) SetDefault(s string) error
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 ¶
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 ¶
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 ¶
Encode - This method is a simple wrapper for encoding an object into JSON
func (*Discovery) EncodeToString ¶
EncodeToString - This method is a simple wrapper for encoding an object into
JSON
func (*Discovery) GetContact ¶
GetContact - This method returns the contact information from the contact
property.
func (*Discovery) GetDefault ¶
GetDefault - This methods returns the default api-root.
func (*Discovery) SetContact ¶
SetContact - This methods takes in a string value representing contact
information and updates the contact property.
func (*Discovery) SetDefault ¶
SetDefault - This methods takes in a string value representing a default
api-root and updates the default property.