sdk

package
v2.21.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

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

Session stores information about a Reva session. It is also responsible for managing the Reva gateway client.

func MustNewSession

func MustNewSession() *Session

MustNewSession creates a new session and panics on failure.

func NewSession

func NewSession() (*Session, error)

NewSession creates a new Reva session using a default background context.

func NewSessionWithContext

func NewSessionWithContext(ctx context.Context) (*Session, error)

NewSessionWithContext creates a new Reva session using the provided context.

func (*Session) BasicLogin

func (session *Session) BasicLogin(username string, password string) error

BasicLogin tries to log into Reva using basic authentication. Before the actual login attempt, the method verifies that the Reva instance does support the "basic" login method.

func (*Session) Client

func (session *Session) Client() gateway.GatewayAPIClient

Client gets the gateway client instance.

func (*Session) Context

func (session *Session) Context() context.Context

Context returns the session context.

func (*Session) GetLoginMethods

func (session *Session) GetLoginMethods() ([]string, error)

GetLoginMethods returns a list of all available login methods supported by the Reva instance.

func (*Session) Initiate

func (session *Session) Initiate(host string, insecure bool) error

Initiate initiates the session by creating a connection to the host and preparing the gateway client.

func (*Session) IsValid

func (session *Session) IsValid() bool

IsValid checks whether the session has been initialized and fully established.

func (*Session) Login

func (session *Session) Login(method string, username string, password string) error

Login logs into Reva using the specified method and user credentials.

func (*Session) NewHTTPRequest

func (session *Session) NewHTTPRequest(endpoint string, method string, transportToken string, data io.Reader) (*net.HTTPRequest, error)

NewHTTPRequest returns an HTTP request instance.

func (*Session) Token

func (session *Session) Token() string

Token returns the session token.

Directories

Path Synopsis
net

Jump to

Keyboard shortcuts

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