sls

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SLSDefaultEndpoint = "log.aliyuncs.com"
	SLSAPIVersion      = "0.6.0"
	Version            = "0.0.1"
)
View Source
const HeaderSLSPrefix1 = "x-log-"
View Source
const HeaderSLSPrefix2 = "x-acs-"

Variables

View Source
var DefaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), Version)

Functions

func CreateSignature

func CreateSignature(stringToSignature, accessKeySecret string) string

CreateSignature creates signature for string following Aliyun rules

func GetGMTime

func GetGMTime() string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(internal bool, region, accessKeyId, accessKeySecret, securityToken string) *Client

func (*Client) ListProject

func (client *Client) ListProject(r ListProjectRequest) (*ListProjectResponse, error)

type Driver

type Driver struct {
	Cred   *credentials.StsTokenCredential
	Region string
}

func (*Driver) ListProjects

func (d *Driver) ListProjects(ctx context.Context) ([]schema.Log, error)

func (*Driver) NewClient

func (d *Driver) NewClient() *Client

type Error

type Error struct {
	StatusCode int
	Code       string `json:"errorCode,omitempty"`
	Message    string `json:"errorMessage,omitempty"`
}

func (*Error) Error

func (err *Error) Error() string

type ListProjectRequest

type ListProjectRequest struct {
	Offset      int32  `json:"offset,omitempty" xml:"offset,omitempty"`
	ProjectName string `json:"projectName,omitempty" xml:"projectName,omitempty"`
	Size        int32  `json:"size,omitempty" xml:"size,omitempty"`
}

func (ListProjectRequest) Map

func (r ListProjectRequest) Map() map[string]string

type ListProjectResponse

type ListProjectResponse struct {
	Count    *int64     `json:"count,omitempty" xml:"count,omitempty"`
	Projects []*Project `json:"projects,omitempty" xml:"projects,omitempty" type:"Repeated"`
	Total    *int64     `json:"total,omitempty" xml:"total,omitempty"`
}

type Project

type Project struct {
	CreateTime      *string `json:"createTime,omitempty" xml:"createTime,omitempty"`
	Description     *string `json:"description,omitempty" xml:"description,omitempty"`
	LastModifyTime  *string `json:"lastModifyTime,omitempty" xml:"lastModifyTime,omitempty"`
	Owner           *string `json:"owner,omitempty" xml:"owner,omitempty"`
	ProjectName     *string `json:"projectName,omitempty" xml:"projectName,omitempty"`
	Region          *string `json:"region,omitempty" xml:"region,omitempty"`
	ResourceGroupId *string `json:"resourceGroupId,omitempty" xml:"resourceGroupId,omitempty"`
	Status          *string `json:"status,omitempty" xml:"status,omitempty"`
}

Jump to

Keyboard shortcuts

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