v2

package
Version: v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

type V2

type V2 struct {

	// Services used for talking to different parts of the Xray API.
	Watches *WatchesService
	// contains filtered or unexported fields
}

func NewV2

func NewV2(client *client.Client) *V2

type Watch

type Watch struct {
	GeneralData      *WatchGeneralData      `json:"general_data,omitempty"`
	ProjectResources *WatchProjectResources `json:"project_resources,omitempty"`
	AssignedPolicies *[]WatchAssignedPolicy `json:"assigned_policies,omitempty"`
}

type WatchAssignedPolicy

type WatchAssignedPolicy struct {
	Name *string `json:"name,omitempty"`
	Type *string `json:"type,omitempty"`
}

type WatchFilter

type WatchFilter struct {
	Type  *string                  `json:"type,omitempty"`
	Value *WatchFilterValueWrapper `json:"value,omitempty"`
}

type WatchFilterValue added in v0.1.2

type WatchFilterValue struct {
	Key   *string `json:"key,omitempty"`
	Value *string `json:"value,omitempty"`
}

type WatchFilterValueWrapper added in v0.1.2

type WatchFilterValueWrapper struct {
	WatchFilterValue
	IsPropertyFilter bool `json:”-”`
}

WatchFilterValueWrapper is a wrapper around WatchFilterValue which handles the API returning both a string and an object for the watch filter value

func (WatchFilterValueWrapper) MarshalJSON added in v0.1.2

func (wf WatchFilterValueWrapper) MarshalJSON() ([]byte, error)

MarshalJSON coverts the WatchFilterValueWrapper into JSON data It returns the JSON data and any errors that occured during the function

func (*WatchFilterValueWrapper) UnmarshalJSON added in v0.1.2

func (wf *WatchFilterValueWrapper) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON data into a WatchFilterValueWrapper object It returns any errors that occured during the function

type WatchGeneralData

type WatchGeneralData struct {
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	Active      *bool   `json:"active,omitempty"`
}

type WatchProjectResource

type WatchProjectResource struct {
	Type            *string        `json:"type,omitempty"`
	BinaryManagerId *string        `json:"bin_mgr_id,omitempty"`
	Name            *string        `json:"name,omitempty"`
	Filters         *[]WatchFilter `json:"filters,omitempty"`
}

type WatchProjectResources

type WatchProjectResources struct {
	Resources *[]WatchProjectResource `json:"resources,omitempty"`
}

type WatchesService

type WatchesService Service

func (*WatchesService) CreateWatch

func (s *WatchesService) CreateWatch(ctx context.Context, watch *Watch) (*http.Response, error)

Description: Creates a new Watch Security: Requires a valid user with "Manage Watches" permission Usage: client.V2.Watches.CreateWatch(ctx, watch)

func (*WatchesService) DeleteWatch

func (s *WatchesService) DeleteWatch(ctx context.Context, name string) (*http.Response, error)

Description: Deletes a Watch Security: Requires a valid user with "Manage Watches" permissions Usage: client.V2.Watches.DeleteWatch(ctx, "name")

func (*WatchesService) GetWatch

func (s *WatchesService) GetWatch(ctx context.Context, name string) (*Watch, *http.Response, error)

Description: Gets a named watch Security: Requires a valid user with "View Watches" permission Usage: client.V2.Watches.GetWatch(ctx, "name")

func (*WatchesService) ListWatches

func (s *WatchesService) ListWatches(ctx context.Context) (*[]Watch, *http.Response, error)

Description: Gets a list of all watches in the system Security: Requires a valid user with "View Watches" permission Usage: client.V2.Watches.ListWatches(ctx)

func (*WatchesService) UpdateWatch

func (s *WatchesService) UpdateWatch(ctx context.Context, name string, watch *Watch) (*http.Response, error)

Description: Updates a Watch. Security: Requires a valid user with "Manage Watches" permission Usage: client.V2.Watches.UpdateWatch(ctx, "name", watch)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL