Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
GlobalDataClient
CollectionsClient
ThreatHuntingClient
HasOrgID() bool
}
type ClientError ¶
type ClientError interface {
cenclierrors.CencliError
Status() string
StatusCode() mo.Option[int64]
}
func NewClientError ¶
func NewClientError(err error) ClientError
type ClientGenericError ¶
type ClientGenericError interface {
ClientError
}
func NewCensysClientGenericError ¶
func NewCensysClientGenericError(err *sdkerrors.SDKError) ClientGenericError
type ClientNotConfiguredError ¶
type ClientNotConfiguredError interface {
cenclierrors.CencliError
}
CensysClientNotConfiguredError isn't really a client error, since it will be used before an API call is made.
func NewCensysClientNotConfiguredError ¶
func NewCensysClientNotConfiguredError() ClientNotConfiguredError
type ClientStructuredError ¶
type ClientStructuredError interface {
ClientError
}
func NewCensysClientStructuredError ¶
func NewCensysClientStructuredError(err *sdkerrors.ErrorModel) ClientStructuredError
type ClientUnauthorizedError ¶
type ClientUnauthorizedError interface {
ClientError
}
func NewCensysClientUnauthorizedError ¶
func NewCensysClientUnauthorizedError(err *sdkerrors.AuthenticationError) ClientUnauthorizedError
type CollectionsClient ¶
type CollectionsClient interface {
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/collections#search
SearchCollection(
ctx context.Context,
collectionID string,
orgID mo.Option[string],
query string,
fields []string,
pageSize mo.Option[int64],
pageToken mo.Option[string],
) (Result[components.SearchQueryResponse], ClientError)
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/collections#aggregate
AggregateCollection(
ctx context.Context,
collectionID string,
orgID mo.Option[string],
query string,
field string,
numBuckets int64,
countByLevel mo.Option[string],
filterByQuery mo.Option[bool],
) (Result[components.SearchAggregateResponse], ClientError)
}
type GlobalDataClient ¶
type GlobalDataClient interface {
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/globaldata#gethosts
GetHosts(
ctx context.Context,
orgID mo.Option[string],
hostIDs []string,
atTime mo.Option[time.Time],
) (Result[[]components.Host], ClientError)
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/globaldata#getcertificates
GetCertificates(
ctx context.Context,
orgID mo.Option[string],
certificateIDs []string,
) (Result[[]components.Certificate], ClientError)
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/globaldata#getwebproperties
GetWebProperties(
ctx context.Context,
orgID mo.Option[string],
webPropertyIDs []string,
atTime mo.Option[time.Time],
) (Result[[]components.Webproperty], ClientError)
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/globaldata#search
Search(
ctx context.Context,
orgID mo.Option[string],
query string,
fields []string,
pageSize mo.Option[int64],
pageToken mo.Option[string],
) (Result[components.SearchQueryResponse], ClientError)
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/globaldata#aggregate
Aggregate(
ctx context.Context,
orgID mo.Option[string],
query string,
field string,
numBuckets int64,
countByLevel mo.Option[string],
filterByQuery mo.Option[bool],
) (Result[components.SearchAggregateResponse], ClientError)
// https://github.com/censys/censys-sdk-go/blob/v0.22.2/models/operations/v3globaldataassethosttimeline.go
// Note: the SDK client has the parameters backwards; fromTime is the end time and toTime is the start time. This is a mistake, but we need to keep it to not break existing API usage, so we abstract this miscommunication through this function's parameters.
HostTimeline(
ctx context.Context,
orgID mo.Option[string],
hostID string,
fromTime time.Time,
toTime time.Time,
) (Result[components.HostTimeline], ClientError)
}
type ThreatHuntingClient ¶
type ThreatHuntingClient interface {
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/threathunting#gethostobservationswithcertificate
GetHostObservationsWithCertificate(
ctx context.Context,
orgID mo.Option[string],
certificateID string,
startTime mo.Option[time.Time],
endTime mo.Option[time.Time],
port mo.Option[int],
protocol mo.Option[string],
pageSize mo.Option[int64],
pageToken mo.Option[string],
) (Result[components.HostObservationResponse], ClientError)
// https://github.com/censys/censys-sdk-go/tree/main/docs/sdks/threathunting#valuecounts
GetValueCounts(
ctx context.Context,
orgID mo.Option[string],
query mo.Option[string],
andCountConditions []components.CountCondition,
) (Result[components.ValueCountsResponse], ClientError)
}
Click to show internal directories.
Click to hide internal directories.