cloudloggingadmin

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const SourceType string = "cloud-logging-admin"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name                      string `yaml:"name" validate:"required"`
	Type                      string `yaml:"type" validate:"required"`
	Project                   string `yaml:"project" validate:"required"`
	UseClientOAuth            bool   `yaml:"useClientOAuth"`
	ImpersonateServiceAccount string `yaml:"impersonateServiceAccount"`
}

func (Config) Initialize

func (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error)

func (Config) SourceConfigType

func (r Config) SourceConfigType() string

type LogAdminClientCreator

type LogAdminClientCreator func(tokenString string) (*logadmin.Client, error)

type QueryLogsParams

type QueryLogsParams struct {
	Filter      string
	NewestFirst bool
	StartTime   string
	EndTime     string
	Verbose     bool
	Limit       int
}

QueryLogsParams contains the parameters for querying logs

type Source

type Source struct {
	Config
	Client        *logadmin.Client
	TokenSource   oauth2.TokenSource
	ClientCreator LogAdminClientCreator
	// contains filtered or unexported fields
}

func (*Source) GetProject

func (s *Source) GetProject() string

func (*Source) ListLogNames

func (s *Source) ListLogNames(ctx context.Context, limit int, accessToken string) ([]string, error)

ListLogNames lists all log names in the project

func (*Source) ListResourceTypes

func (s *Source) ListResourceTypes(ctx context.Context, accessToken string) ([]string, error)

ListResourceTypes lists all resource types in the project

func (*Source) LogAdminClient

func (s *Source) LogAdminClient() *logadmin.Client

func (*Source) LogAdminClientCreator

func (s *Source) LogAdminClientCreator() LogAdminClientCreator

func (*Source) LogAdminTokenSource

func (s *Source) LogAdminTokenSource() oauth2.TokenSource

func (*Source) QueryLogs

func (s *Source) QueryLogs(ctx context.Context, params QueryLogsParams, accessToken string) ([]map[string]any, error)

QueryLogs queries log entries based on the provided parameters

func (*Source) SourceType

func (s *Source) SourceType() string

func (*Source) ToConfig

func (s *Source) ToConfig() sources.SourceConfig

func (*Source) UseClientAuthorization

func (s *Source) UseClientAuthorization() bool

Jump to

Keyboard shortcuts

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