Documentation ¶
Index ¶
- type Service
- type V2
- type Watch
- type WatchAssignedPolicy
- type WatchFilter
- type WatchFilterValue
- type WatchFilterValueWrapper
- type WatchGeneralData
- type WatchProjectResource
- type WatchProjectResources
- type WatchesService
- func (s *WatchesService) CreateWatch(ctx context.Context, watch *Watch) (*http.Response, error)
- func (s *WatchesService) DeleteWatch(ctx context.Context, name string) (*http.Response, error)
- func (s *WatchesService) GetWatch(ctx context.Context, name string) (*Watch, *http.Response, error)
- func (s *WatchesService) ListWatches(ctx context.Context) (*[]Watch, *http.Response, error)
- func (s *WatchesService) UpdateWatch(ctx context.Context, name string, watch *Watch) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type V2 ¶
type V2 struct { // Services used for talking to different parts of the Xray API. Watches *WatchesService // contains filtered or unexported fields }
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 WatchFilter ¶
type WatchFilter struct { Type *string `json:"type,omitempty"` Value *WatchFilterValueWrapper `json:"value,omitempty"` }
type WatchFilterValue ¶ added in v0.1.2
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 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 ¶
Description: Creates a new Watch Security: Requires a valid user with "Manage Watches" permission Usage: client.V2.Watches.CreateWatch(ctx, watch)
func (*WatchesService) DeleteWatch ¶
Description: Deletes a Watch Security: Requires a valid user with "Manage Watches" permissions Usage: client.V2.Watches.DeleteWatch(ctx, "name")
func (*WatchesService) GetWatch ¶
Description: Gets a named watch Security: Requires a valid user with "View Watches" permission Usage: client.V2.Watches.GetWatch(ctx, "name")
func (*WatchesService) ListWatches ¶
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)