session

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Copier

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

Copier copies data between struct

func NewCopier

func NewCopier(src, dest reflect.Type) *Copier

NewCopier creates a copier

func (*Copier) Copy

func (c *Copier) Copy(src interface{}, dest interface{}, opts ...CopierOption) error

Copy copes field with the same name (initial version)

type CopierOption

type CopierOption func(o *copierOptions)

Copier copies data between struct

func WithDebug

func WithDebug() CopierOption

type Option

type Option func(o *Options)

func AsOptions

func AsOptions(opts ...[]Option) []Option

AsOptions merges multi options

func WithCodeOptions

func WithCodeOptions(options ...codec.Option) Option

func WithComponent added in v0.9.14

func WithComponent(component *repository.Component) Option

func WithEmbeddedFS

func WithEmbeddedFS(fs *embed.FS) Option

func WithLocatorOptions

func WithLocatorOptions(options ...locator.Option) Option

func WithLocators

func WithLocators(locators *locator.KindLocator) Option

func WithOperate added in v0.9.14

func WithOperate(operate func(ctx context.Context, aSession *Session, aComponent *repository.Component) (interface{}, error)) Option

func WithRegistry added in v0.9.13

func WithRegistry(registry *repository.Registry) Option

func WithReportNotAssignable

func WithReportNotAssignable(flag bool) Option

func WithScope added in v0.9.14

func WithScope(scope string) Option

func WithStateResource

func WithStateResource(resource state.Resource) Option

func WithTypes

func WithTypes(types ...*state.Type) Option

type Options

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

func NewOptions

func NewOptions(options ...Option) *Options

func (*Options) AddCodec

func (o *Options) AddCodec(option codec.Option)

func (*Options) AddLocator

func (o *Options) AddLocator(option locator.Option)

func (*Options) AddLocators

func (o *Options) AddLocators(options ...locator.Option)

func (*Options) Clone

func (o *Options) Clone() *Options

func (*Options) HasInputParameters added in v0.9.7

func (o *Options) HasInputParameters() bool

func (*Options) Indirect

func (o *Options) Indirect(flag bool, options ...locator.Option) *Options

func (*Options) Operate added in v0.9.14

func (o *Options) Operate() func(ctx context.Context, aSession *Session, aComponent *repository.Component) (interface{}, error)

func (*Options) Registry added in v0.9.13

func (o *Options) Registry() *repository.Registry

func (*Options) State

func (o *Options) State() *view.State

type Redirect added in v0.9.12

type Redirect struct {
	Route   *xhttp.Route
	Request *http.Request
}

type Session

type Session struct {
	Options
	Types    state.Types
	Redirect *Redirect
	// contains filtered or unexported fields
}

func Context

func Context(ctx context.Context) *Session

Context returns session context

func New

func New(aView *view.View, opts ...Option) *Session

func (*Session) Apply

func (s *Session) Apply(opts ...Option)

Apply applies Options

func (*Session) ClearCache

func (s *Session) ClearCache(parameters state.Parameters)

func (*Session) Context

func (s *Session) Context(ctx context.Context, forceNew bool) context.Context

Context returns session context

func (*Session) HttpRequest

func (s *Session) HttpRequest(ctx context.Context, options *Options) (*http.Request, error)

func (*Session) InitKinds

func (s *Session) InitKinds(kinds ...state.Kind) error

func (*Session) Into

func (s *Session) Into(ctx context.Context, dest interface{}, opts ...hstate.Option) (err error)

func (*Session) LoadState

func (s *Session) LoadState(parameters state.Parameters, aState interface{}) error

func (*Session) LookupValue

func (s *Session) LookupValue(ctx context.Context, parameter *state.Parameter, opts *Options) (value interface{}, has bool, err error)

func (*Session) MarshalJSON

func (s *Session) MarshalJSON() ([]byte, error)

func (*Session) Populate

func (s *Session) Populate(ctx context.Context) error

Populate populates view state

func (*Session) ReadInto

func (s *Session) ReadInto(ctx context.Context, dest interface{}, aView *view.View) error

func (*Session) ResetViewState

func (s *Session) ResetViewState(ctx context.Context, aView *view.View) error

ResetViewState sets view state

func (*Session) SetCacheValue

func (s *Session) SetCacheValue(ctx context.Context, parameter *state.Parameter, value interface{}) error

SetCacheValue sets cache value

func (*Session) SetState

func (s *Session) SetState(ctx context.Context, parameters state.Parameters, aState *structology.State, opts *Options) error

func (*Session) SetView added in v0.9.0

func (s *Session) SetView(view *view.View)

func (*Session) SetViewState

func (s *Session) SetViewState(ctx context.Context, aView *view.View) error

SetViewState sets view state as long state has not been populated

func (*Session) Unmarshal

func (s *Session) Unmarshal(parameters state.Parameters, data []byte) error

func (*Session) Value

func (s *Session) Value(ctx context.Context, key string) (interface{}, bool, error)

func (*Session) ValuesOf added in v0.9.12

func (s *Session) ValuesOf(ctx context.Context, any interface{}) (map[string]interface{}, error)

func (*Session) ViewOptions

func (s *Session) ViewOptions(aView *view.View, opts ...Option) *Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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