v1

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthData

type AuthData struct {
	ClientName   string `json:"clientName"`
	ClientSecret string `json:"clientSecret"`
	ServerURL    string `json:"serverURL"`
	JwtSecret    string `json:"jwtSecret"`
}

func NewAuthData

func NewAuthData(clientName string, clientSecret string, serverURL string, jwtSecret string) *AuthData

type GraphQLClient

type GraphQLClient struct {
	TokenData *TokenData
	// contains filtered or unexported fields
}

func NewGraphQLClient

func NewGraphQLClient(authData *AuthData) *GraphQLClient

func (*GraphQLClient) ExecuteLogRequestsMutation

func (gql *GraphQLClient) ExecuteLogRequestsMutation(requestsMap *map[string]time.Time) (LogResponse, error)

func (*GraphQLClient) ExecuteRedirectsQuery

func (gql *GraphQLClient) ExecuteRedirectsQuery() ([]Redirect, error)

func (*GraphQLClient) GetClient

func (gql *GraphQLClient) GetClient() *graphql.Client

GetClient makes sure the access token is refreshed

type LogRequestsInput

type LogRequestsInput struct {
	RequestURL string    `json:"requestURL"`
	HitTime    time.Time `json:"hitTime"`
}

type LogResponse

type LogResponse struct {
	Success bool   `graphql:"success"`
	Message string `graphql:"message"`
}

type Redirect

type Redirect struct {
	Id        string    `graphql:"id"`
	FromURL   string    `graphql:"fromURL"`
	ToURL     string    `graphql:"toURL"`
	UpdatedAt time.Time `graphql:"updatedAt"`
}

type TokenData

type TokenData struct {
	Token    string
	ClientId string
}

func NewTokenData

func NewTokenData() *TokenData

Jump to

Keyboard shortcuts

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