graphql

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Address string
	Client  genqlientgraphql.Client
}

func NewClient

func NewClient(address string, tokenSrc oauth2.TokenSource) *Client

func NewClientFromToken

func NewClientFromToken(address string, token string) *Client

func (*Client) RegisterAuth0User

func (c *Client) RegisterAuth0User(ctx context.Context) (MeFields, error)

type CreateUserFromAuth0UserMeMeMutation

type CreateUserFromAuth0UserMeMeMutation struct {
	// Register the user defined by the active session token into the otterize users store.
	RegisterUser CreateUserFromAuth0UserMeMeMutationRegisterUserMe `json:"registerUser"`
}

CreateUserFromAuth0UserMeMeMutation includes the requested fields of the GraphQL type MeMutation.

func (*CreateUserFromAuth0UserMeMeMutation) GetRegisterUser

GetRegisterUser returns CreateUserFromAuth0UserMeMeMutation.RegisterUser, and is useful for accessing the field via an interface.

type CreateUserFromAuth0UserMeMeMutationRegisterUserMe

type CreateUserFromAuth0UserMeMeMutationRegisterUserMe struct {
	MeFields `json:"-"`
}

CreateUserFromAuth0UserMeMeMutationRegisterUserMe includes the requested fields of the GraphQL type Me.

func (*CreateUserFromAuth0UserMeMeMutationRegisterUserMe) GetOrganizations

GetOrganizations returns CreateUserFromAuth0UserMeMeMutationRegisterUserMe.Organizations, and is useful for accessing the field via an interface.

func (*CreateUserFromAuth0UserMeMeMutationRegisterUserMe) GetUser

GetUser returns CreateUserFromAuth0UserMeMeMutationRegisterUserMe.User, and is useful for accessing the field via an interface.

func (*CreateUserFromAuth0UserMeMeMutationRegisterUserMe) MarshalJSON

func (*CreateUserFromAuth0UserMeMeMutationRegisterUserMe) UnmarshalJSON

type CreateUserFromAuth0UserResponse

type CreateUserFromAuth0UserResponse struct {
	// Operate on the current logged-in user
	Me CreateUserFromAuth0UserMeMeMutation `json:"me"`
}

CreateUserFromAuth0UserResponse is returned by CreateUserFromAuth0User on success.

func CreateUserFromAuth0User

func CreateUserFromAuth0User(
	ctx context.Context,
	client graphql.Client,
) (*CreateUserFromAuth0UserResponse, error)

func (*CreateUserFromAuth0UserResponse) GetMe

GetMe returns CreateUserFromAuth0UserResponse.Me, and is useful for accessing the field via an interface.

type MeFields

type MeFields struct {
	// The logged-in user details.
	User MeFieldsUser `json:"user"`
	// The organizations to which the current logged-in user belongs.
	Organizations []MeFieldsOrganizationsOrganization `json:"organizations"`
}

MeFields includes the GraphQL fields of Me requested by the fragment MeFields.

func (*MeFields) GetOrganizations

func (v *MeFields) GetOrganizations() []MeFieldsOrganizationsOrganization

GetOrganizations returns MeFields.Organizations, and is useful for accessing the field via an interface.

func (*MeFields) GetUser

func (v *MeFields) GetUser() MeFieldsUser

GetUser returns MeFields.User, and is useful for accessing the field via an interface.

type MeFieldsOrganizationsOrganization

type MeFieldsOrganizationsOrganization struct {
	Id string `json:"id"`
}

MeFieldsOrganizationsOrganization includes the requested fields of the GraphQL type Organization.

func (*MeFieldsOrganizationsOrganization) GetId

GetId returns MeFieldsOrganizationsOrganization.Id, and is useful for accessing the field via an interface.

type MeFieldsUser

type MeFieldsUser struct {
	Id    string `json:"id"`
	Email string `json:"email"`
	Name  string `json:"name"`
}

MeFieldsUser includes the requested fields of the GraphQL type User.

func (*MeFieldsUser) GetEmail

func (v *MeFieldsUser) GetEmail() string

GetEmail returns MeFieldsUser.Email, and is useful for accessing the field via an interface.

func (*MeFieldsUser) GetId

func (v *MeFieldsUser) GetId() string

GetId returns MeFieldsUser.Id, and is useful for accessing the field via an interface.

func (*MeFieldsUser) GetName

func (v *MeFieldsUser) GetName() string

GetName returns MeFieldsUser.Name, and is useful for accessing the field via an interface.

Jump to

Keyboard shortcuts

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