Skip to content

Latest commit

 

History

History
110 lines (80 loc) · 4.29 KB

File metadata and controls

110 lines (80 loc) · 4.29 KB

Attacks

(Attacks)

Overview

Attacks API

Available Operations

GetAttack

Returns an attack by id. This is used to get the details of an attack.

Example Usage

package main

import(
	cipherswarmagentsdkgo "github.com/unclesp1d3r/cipherswarm-agent-sdk-go"
	"context"
	"log"
)

func main() {
    s := cipherswarmagentsdkgo.New(
        cipherswarmagentsdkgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Attacks.GetAttack(ctx, 535539)
    if err != nil {
        log.Fatal(err)
    }
    if res.Attack != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
id int64 ✔️ id
opts []operations.Option The options for this request.

Response

*operations.GetAttackResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.ErrorObject 401, 404 application/json
sdkerrors.SDKError 4XX, 5XX */*

GetHashList

Returns the hash list for an attack.

Example Usage

package main

import(
	cipherswarmagentsdkgo "github.com/unclesp1d3r/cipherswarm-agent-sdk-go"
	"context"
	"log"
)

func main() {
    s := cipherswarmagentsdkgo.New(
        cipherswarmagentsdkgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Attacks.GetHashList(ctx, 904122)
    if err != nil {
        log.Fatal(err)
    }
    if res.ResponseStream != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
id int64 ✔️ id
opts []operations.Option The options for this request.

Response

*operations.GetHashListResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*