insight

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package insightiface provides an interface to enable mocking the INSIGHT service client for testing your code.

It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters.

Index

Constants

View Source
const (
	ServiceName = "insight"   // Name of service.
	EndpointsID = ServiceName // ID to lookup a service endpoint with.
	ServiceID   = "insight"   // ServiceID is a unique identifer of a specific service.
)

Service information constants

Variables

This section is empty.

Functions

This section is empty.

Types

type INSIGHT

type INSIGHT struct {
	*client.Client
}

INSIGHT provides the API operation methods for making requests to INSIGHT. See this package's package overview docs for details on the service.

INSIGHT methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(p client.ConfigProvider, cfgs ...*volcengine.Config) *INSIGHT

New create int can support ssl or region locate set

func (*INSIGHT) PullPost

func (c *INSIGHT) PullPost(input *PullPostInput) (*PullPostOutput, error)

PullPost API operation for INSIGHT.

Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions with volcengineerr.Error's Code and Message methods to get detailed information about the error.

See the VOLCENGINE API reference guide for INSIGHT's API operation PullPost for usage and error information.

func (*INSIGHT) PullPostCommon

func (c *INSIGHT) PullPostCommon(input *map[string]interface{}) (*map[string]interface{}, error)

PullPostCommon API operation for INSIGHT.

Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions with volcengineerr.Error's Code and Message methods to get detailed information about the error.

See the VOLCENGINE API reference guide for INSIGHT's API operation PullPostCommon for usage and error information.

func (*INSIGHT) PullPostCommonRequest

func (c *INSIGHT) PullPostCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{})

PullPostCommonRequest generates a "volcengine/request.Request" representing the client's request for the PullPostCommon operation. The "output" return value will be populated with the PullPostCommon request's response once the request completes successfully.

Use "Send" method on the returned PullPostCommon Request to send the API call to the service. the "output" return value is not valid until after PullPostCommon Send returns without error.

See PullPostCommon for more information on using the PullPostCommon API call, and error handling.

// Example sending a request using the PullPostCommonRequest method.
req, resp := client.PullPostCommonRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*INSIGHT) PullPostCommonWithContext

func (c *INSIGHT) PullPostCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error)

PullPostCommonWithContext is the same as PullPostCommon with the addition of the ability to pass a context and additional request options.

See PullPostCommon for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*INSIGHT) PullPostRequest

func (c *INSIGHT) PullPostRequest(input *PullPostInput) (req *request.Request, output *PullPostOutput)

PullPostRequest generates a "volcengine/request.Request" representing the client's request for the PullPost operation. The "output" return value will be populated with the PullPostCommon request's response once the request completes successfully.

Use "Send" method on the returned PullPostCommon Request to send the API call to the service. the "output" return value is not valid until after PullPostCommon Send returns without error.

See PullPost for more information on using the PullPost API call, and error handling.

// Example sending a request using the PullPostRequest method.
req, resp := client.PullPostRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*INSIGHT) PullPostWithContext

func (c *INSIGHT) PullPostWithContext(ctx volcengine.Context, input *PullPostInput, opts ...request.Option) (*PullPostOutput, error)

PullPostWithContext is the same as PullPost with the addition of the ability to pass a context and additional request options.

See PullPost for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

type INSIGHTAPI

type INSIGHTAPI interface {
	PullPostCommon(*map[string]interface{}) (*map[string]interface{}, error)
	PullPostCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error)
	PullPostCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{})

	PullPost(*PullPostInput) (*PullPostOutput, error)
	PullPostWithContext(volcengine.Context, *PullPostInput, ...request.Option) (*PullPostOutput, error)
	PullPostRequest(*PullPostInput) (*request.Request, *PullPostOutput)
}

INSIGHTAPI provides an interface to enable mocking the insight.INSIGHT service client's API operation,

// volcengine sdk func uses an SDK service client to make a request to
// INSIGHT.
func myFunc(svc INSIGHTAPI) bool {
    // Make svc.PullPost request
}

func main() {
    sess := session.New()
    svc := insight.New(sess)

    myFunc(svc)
}

type ItemDocForPullPostOutput

type ItemDocForPullPostOutput struct {
	Asr *string `type:"string" json:",omitempty"`

	Content *string `type:"string" json:",omitempty"`

	DedupID *string `type:"string" json:",omitempty"`

	Emotion *string `type:"string" json:",omitempty"`

	FansCount *int32 `type:"int32" json:",omitempty"`

	IsFollow *bool `type:"boolean" json:",omitempty"`

	Locations []*LocationForPullPostOutput `type:"list" json:"locations,omitempty"`

	MainDomain *string `type:"string" json:",omitempty"`

	MediaName *string `type:"string" json:",omitempty"`

	Ocr *string `type:"string" json:",omitempty"`

	OcrHigh *string `type:"string" json:",omitempty"`

	PostID *string `type:"string" json:",omitempty"`

	PublishTime *string `type:"string" json:",omitempty"`

	Reason *string `type:"string" json:",omitempty"`

	RiskType []*string `type:"list" json:",omitempty"`

	Summary *string `type:"string" json:",omitempty"`

	Title *string `type:"string" json:",omitempty"`

	Url *string `type:"string" json:",omitempty"`
	// contains filtered or unexported fields
}

func (ItemDocForPullPostOutput) GoString

func (s ItemDocForPullPostOutput) GoString() string

GoString returns the string representation

func (*ItemDocForPullPostOutput) SetAsr

SetAsr sets the Asr field's value.

func (*ItemDocForPullPostOutput) SetContent

SetContent sets the Content field's value.

func (*ItemDocForPullPostOutput) SetDedupID

SetDedupID sets the DedupID field's value.

func (*ItemDocForPullPostOutput) SetEmotion

SetEmotion sets the Emotion field's value.

func (*ItemDocForPullPostOutput) SetFansCount

SetFansCount sets the FansCount field's value.

func (*ItemDocForPullPostOutput) SetIsFollow

SetIsFollow sets the IsFollow field's value.

func (*ItemDocForPullPostOutput) SetLocations

SetLocations sets the Locations field's value.

func (*ItemDocForPullPostOutput) SetMainDomain

SetMainDomain sets the MainDomain field's value.

func (*ItemDocForPullPostOutput) SetMediaName

SetMediaName sets the MediaName field's value.

func (*ItemDocForPullPostOutput) SetOcr

SetOcr sets the Ocr field's value.

func (*ItemDocForPullPostOutput) SetOcrHigh

SetOcrHigh sets the OcrHigh field's value.

func (*ItemDocForPullPostOutput) SetPostID

SetPostID sets the PostID field's value.

func (*ItemDocForPullPostOutput) SetPublishTime

SetPublishTime sets the PublishTime field's value.

func (*ItemDocForPullPostOutput) SetReason

SetReason sets the Reason field's value.

func (*ItemDocForPullPostOutput) SetRiskType

SetRiskType sets the RiskType field's value.

func (*ItemDocForPullPostOutput) SetSummary

SetSummary sets the Summary field's value.

func (*ItemDocForPullPostOutput) SetTitle

SetTitle sets the Title field's value.

func (*ItemDocForPullPostOutput) SetUrl

SetUrl sets the Url field's value.

func (ItemDocForPullPostOutput) String

func (s ItemDocForPullPostOutput) String() string

String returns the string representation

type LocationForPullPostOutput

type LocationForPullPostOutput struct {
	City *string `type:"string" json:",omitempty"`

	CityCode *string `type:"string" json:",omitempty"`

	District *string `type:"string" json:",omitempty"`

	DistrictCode *string `type:"string" json:",omitempty"`

	Location *string `type:"string" json:",omitempty"`

	Name *string `type:"string" json:",omitempty"`

	Province *string `type:"string" json:",omitempty"`

	Region *string `type:"string" json:",omitempty"`

	RegionCode *string `type:"string" json:",omitempty"`

	Town *string `type:"string" json:",omitempty"`

	TownCode *string `type:"string" json:",omitempty"`
	// contains filtered or unexported fields
}

func (LocationForPullPostOutput) GoString

func (s LocationForPullPostOutput) GoString() string

GoString returns the string representation

func (*LocationForPullPostOutput) SetCity

SetCity sets the City field's value.

func (*LocationForPullPostOutput) SetCityCode

SetCityCode sets the CityCode field's value.

func (*LocationForPullPostOutput) SetDistrict

SetDistrict sets the District field's value.

func (*LocationForPullPostOutput) SetDistrictCode

SetDistrictCode sets the DistrictCode field's value.

func (*LocationForPullPostOutput) SetLocation

SetLocation sets the Location field's value.

func (*LocationForPullPostOutput) SetName

SetName sets the Name field's value.

func (*LocationForPullPostOutput) SetProvince

SetProvince sets the Province field's value.

func (*LocationForPullPostOutput) SetRegion

SetRegion sets the Region field's value.

func (*LocationForPullPostOutput) SetRegionCode

SetRegionCode sets the RegionCode field's value.

func (*LocationForPullPostOutput) SetTown

SetTown sets the Town field's value.

func (*LocationForPullPostOutput) SetTownCode

SetTownCode sets the TownCode field's value.

func (LocationForPullPostOutput) String

func (s LocationForPullPostOutput) String() string

String returns the string representation

type PullPostInput

type PullPostInput struct {
	EndTime *string `type:"string" json:",omitempty"`

	PageToken *string `type:"string" json:",omitempty"`

	Size *int32 `type:"int32" json:",omitempty"`

	StartTime *string `type:"string" json:",omitempty"`

	// TaskID is a required field
	TaskID *int32 `type:"int32" json:",omitempty" required:"true"`
	// contains filtered or unexported fields
}

func (PullPostInput) GoString

func (s PullPostInput) GoString() string

GoString returns the string representation

func (*PullPostInput) SetEndTime

func (s *PullPostInput) SetEndTime(v string) *PullPostInput

SetEndTime sets the EndTime field's value.

func (*PullPostInput) SetPageToken

func (s *PullPostInput) SetPageToken(v string) *PullPostInput

SetPageToken sets the PageToken field's value.

func (*PullPostInput) SetSize

func (s *PullPostInput) SetSize(v int32) *PullPostInput

SetSize sets the Size field's value.

func (*PullPostInput) SetStartTime

func (s *PullPostInput) SetStartTime(v string) *PullPostInput

SetStartTime sets the StartTime field's value.

func (*PullPostInput) SetTaskID

func (s *PullPostInput) SetTaskID(v int32) *PullPostInput

SetTaskID sets the TaskID field's value.

func (PullPostInput) String

func (s PullPostInput) String() string

String returns the string representation

func (*PullPostInput) Validate

func (s *PullPostInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type PullPostOutput

type PullPostOutput struct {
	Metadata *response.ResponseMetadata

	HasMore *bool `type:"boolean" json:",omitempty"`

	ItemDocs []*ItemDocForPullPostOutput `type:"list" json:",omitempty"`

	NextPageToken *string `type:"string" json:",omitempty"`
	// contains filtered or unexported fields
}

func (PullPostOutput) GoString

func (s PullPostOutput) GoString() string

GoString returns the string representation

func (*PullPostOutput) SetHasMore

func (s *PullPostOutput) SetHasMore(v bool) *PullPostOutput

SetHasMore sets the HasMore field's value.

func (*PullPostOutput) SetItemDocs

SetItemDocs sets the ItemDocs field's value.

func (*PullPostOutput) SetNextPageToken

func (s *PullPostOutput) SetNextPageToken(v string) *PullPostOutput

SetNextPageToken sets the NextPageToken field's value.

func (PullPostOutput) String

func (s PullPostOutput) String() string

String returns the string representation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL