Skip to content

Latest commit

 

History

History
106 lines (80 loc) · 4.31 KB

File metadata and controls

106 lines (80 loc) · 4.31 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>"),
    )
    var id int64 = 535539
    ctx := context.Background()
    res, err := s.Attacks.GetAttack(ctx, id)
    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

Error Object 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>"),
    )
    var id int64 = 904122
    ctx := context.Background()
    res, err := s.Attacks.GetHashList(ctx, id)
    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

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /