gitlab

package
v0.0.0-...-6f6b6b6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	GraphQL  *graphql.Client
	Endpoint string
	Token    string
}

Client ..

func NewClient

func NewClient(endpoint, token string) Client

NewClient returns a new Client

func (*Client) GetProjectTerraformStates

func (c *Client) GetProjectTerraformStates(pathWithNamespace string) (terraformStates TerraformStates, err error)

GetProjectTerraformStates ..

func (*Client) GetProjectsWithTerraformStates

func (c *Client) GetProjectsWithTerraformStates() (projects Projects, err error)

GetProjectsWithTerraformStates ..

func (*Client) GetState

func (c *Client) GetState(projectID, stateName, version string) (state []byte, err error)

GetState ..

func (*Client) Query

func (c *Client) Query(request string, response interface{}, vars map[string]interface{}) error

Query ..

type Project

type Project struct {
	ID                string
	PathWithNamespace string
	TerraformStates   TerraformStates
}

Project ..

type ProjectTerraformStatesResponse

type ProjectTerraformStatesResponse struct {
	Project struct {
		TerraformStates struct {
			PageInfo struct {
				EndCursor   string `json:"endCursor"`
				HasNextPage bool   `json:"hasNextPage"`
			} `json:"pageInfo"`
			Nodes []struct {
				ID           string     `json:"id"`
				Name         string     `json:"name"`
				LockedAt     *time.Time `json:"lockedAt"`
				LockedByUser *struct {
					PublicEmail string `json:"publicEmail"`
				} `json:"lockedByUser"`
				LatestVersion struct {
					Serial        int       `json:"serial"`
					CreatedAt     time.Time `json:"createdAt"`
					CreatedByUser struct {
						PublicEmail string `json:"publicEmail"`
					} `json:"createdByUser"`
				} `json:"latestVersion"`
			} `json:"nodes"`
		} `json:"terraformStates"`
	} `json:"project"`
}

ProjectTerraformStatesResponse ..

type Projects

type Projects []Project

Projects ..

type ProjectsResponse

type ProjectsResponse struct {
	Projects struct {
		PageInfo struct {
			EndCursor   string `json:"endCursor"`
			HasNextPage bool   `json:"hasNextPage"`
		} `json:"pageInfo"`
		Nodes []struct {
			ID              string `json:"id"`
			FullPath        string `json:"fullPath"`
			TerraformStates struct {
				Count int `json:"count"`
			} `json:"terraformStates"`
		} `json:"nodes"`
	} `json:"projects"`
}

ProjectsResponse ..

type TerraformState

type TerraformState struct {
	ID                       string
	Name                     string
	ProjectPathWithNamespace string
	LatestVersion            struct {
		CreatedAt time.Time
		CreatedBy string
		Serial    int
	}
	Lock *TerraformStateLock
}

TerraformState ..

func (*TerraformState) GlobalPath

func (s *TerraformState) GlobalPath() string

GlobalPath ..

type TerraformStateLock

type TerraformStateLock struct {
	CreatedAt time.Time
	CreatedBy string
}

TerraformStateLock ..

type TerraformStates

type TerraformStates []TerraformState

TerraformStates ..

Jump to

Keyboard shortcuts

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